Fix Gradle task to properly detect Smithy model changes#4326
Merged
Conversation
|
A new generated diff is ready to view.
A new doc preview is ready to view. |
22445f6 to
32076d6
Compare
|
A new generated diff is ready to view.
A new doc preview is ready to view. |
The generateSmithyBuild task was not correctly declaring Smithy model files as inputs, causing it to not regenerate when models changed. This fixes the path resolution and adds an existence check for the input files.
32076d6 to
c484b2d
Compare
|
A new generated diff is ready to view.
A new doc preview is ready to view. |
aajtodd
approved these changes
Oct 6, 2025
| allCodegenTests.flatMap { it.imports }.forEach { inputs.file(project.projectDir.resolve(it)) } | ||
| // Declare Smithy model files as inputs so task reruns when they change | ||
| allCodegenTests.flatMap { it.imports }.forEach { | ||
| val resolvedPath = project.projectDir.resolve(it) |
Contributor
There was a problem hiding this comment.
I don't know if you actually need this (not that it hurts anything)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
generateSmithyBuildtask was not correctly declaring Smithy model files as inputs, causing it to not regenerate when models changed. This fixes the path resolution and adds an existence check for the input files.Problem
When running
./gradlew codegen-server-test:assemble, the task would not regenerate the server code when Smithy model files were modified because the Gradle task inputs were not properly declared.Solution
rootProject.projectDir.resolve(it)toproject.projectDir.resolve(it)since import paths are relative to the project directoryTesting
./gradlew codegen-server-test:assembleregenerates code when models change