Allow access to smithyCli configuration #130
Merged
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.
Background
smithyCli
configuration visible so a customer can explicitly set the CLI artifact without setting asmithy-model
dependency in theruntimeClasspath
configuration (typically through theimplementation
configuration.While the CLI version can be resolved from a runtime dependency on
smithy-model
, users sometimes want to explicitly configure a CLI artifact to use without any runtime dependencies on the smithy-model package.Currently the best way to do this is with a build script dependency:
With this change a customer can set the cli artifact as:
Which results in the following resolved configurations:
What happens when conflicting deps are set?
If the smithy cli dependency is set in the smithyCli configuration then we will not attempt to resolve the cli artifact version from the smithy-model dependency.
If conflicting dependencies are set then the higher version is used by default unless a customer sets up a custom resolution strategy. The smithyCli configuration extends the runtimeClasspath configuration (if available) so it will use the higher version set in the runtimeClasspath configuration but the reverse will not be true.
For example the following:
Will resolve to:
While the following:
dependencies {
smithyCli("software.amazon.smithy:smithy-cli:1.45.0")
implementation("software.amazon.smithy:smithy-model:1.43.0")
}
smithyCli - Configuration for Smithy CLI and associated dependencies.
+--- software.amazon.smithy:smithy-model:1.43.0 -> 1.45.0
| --- software.amazon.smithy:smithy-utils:1.45.0
--- software.amazon.smithy:smithy-cli:1.45.0
+--- software.amazon.smithy:smithy-model:1.45.0 ()
+--- software.amazon.smithy:smithy-build:1.45.0
| +--- software.amazon.smithy:smithy-utils:1.45.0
| --- software.amazon.smithy:smithy-model:1.45.0 ()
+--- software.amazon.smithy:smithy-diff:1.45.0
| +--- software.amazon.smithy:smithy-utils:1.45.0
| --- software.amazon.smithy:smithy-model:1.45.0 ()
--- software.amazon.smithy:smithy-syntax:1.45.0
+--- software.amazon.smithy:smithy-model:1.45.0 ()
--- software.amazon.smithy:smithy-utils:1.45.0
runtimeClasspath - Runtime classpath of source set 'main'.
--- software.amazon.smithy:smithy-model:1.43.0
--- software.amazon.smithy:smithy-utils:1.43.0