Skip to content

Commit 6cdee41

Browse files
fix(codegen): use specific Smithy version (#3011)
This centralizes the Smithy version in the root Gradle file for ease of use, and locks the CLI to the same Smithy version as the Smithy dependencies.
1 parent 3bc91c0 commit 6cdee41

File tree

5 files changed

+31
-9
lines changed

5 files changed

+31
-9
lines changed

codegen/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ allprojects {
3131
version = "0.7.0"
3232
}
3333

34+
extra["smithyVersion"] = "[1.12.0,1.13.0["
35+
3436
// The root project doesn't produce a JAR.
3537
tasks["jar"].enabled = false
3638

codegen/generic-client-test-codegen/build.gradle.kts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,21 @@
1515

1616
import software.amazon.smithy.gradle.tasks.SmithyBuild
1717

18+
buildscript {
19+
repositories {
20+
mavenCentral()
21+
}
22+
dependencies {
23+
"classpath"("software.amazon.smithy:smithy-cli:${rootProject.extra["smithyVersion"]}")
24+
}
25+
}
26+
1827
plugins {
1928
id("software.amazon.smithy") version "0.5.3"
2029
}
2130

2231
dependencies {
23-
implementation("software.amazon.smithy:smithy-aws-protocol-tests:[1.12.0, 1.13.0[")
32+
implementation("software.amazon.smithy:smithy-aws-protocol-tests:${rootProject.extra["smithyVersion"]}")
2433
implementation(project(":smithy-aws-typescript-codegen"))
2534
}
2635

codegen/protocol-test-codegen/build.gradle.kts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,21 @@
1515

1616
import software.amazon.smithy.gradle.tasks.SmithyBuild
1717

18+
buildscript {
19+
repositories {
20+
mavenCentral()
21+
}
22+
dependencies {
23+
"classpath"("software.amazon.smithy:smithy-cli:1.12.+")
24+
}
25+
}
26+
1827
plugins {
1928
id("software.amazon.smithy") version "0.5.3"
2029
}
2130

2231
dependencies {
23-
implementation("software.amazon.smithy:smithy-aws-protocol-tests:[1.12.0, 1.13.0[")
32+
implementation("software.amazon.smithy:smithy-aws-protocol-tests:${rootProject.extra["smithyVersion"]}")
2433
implementation(project(":smithy-aws-typescript-codegen"))
2534
}
2635

codegen/sdk-codegen/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ buildscript {
2525
mavenCentral()
2626
}
2727
dependencies {
28-
"classpath"("software.amazon.smithy:smithy-aws-traits:[1.12.0,1.13.0[")
28+
"classpath"("software.amazon.smithy:smithy-cli:${rootProject.extra["smithyVersion"]}")
29+
"classpath"("software.amazon.smithy:smithy-aws-traits:${rootProject.extra["smithyVersion"]}")
2930
}
3031
}
3132

codegen/smithy-aws-typescript-codegen/build.gradle.kts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,17 @@ buildscript {
2525
mavenCentral()
2626
}
2727
dependencies {
28-
classpath("software.amazon.smithy:smithy-model:[1.12.0, 1.13.0[")
28+
classpath("software.amazon.smithy:smithy-model:${rootProject.extra["smithyVersion"]}")
2929
}
3030
}
3131

3232
dependencies {
33-
api("software.amazon.smithy:smithy-aws-cloudformation-traits:[1.12.0, 1.13.0[")
34-
api("software.amazon.smithy:smithy-aws-traits:[1.12.0, 1.13.0[")
35-
api("software.amazon.smithy:smithy-waiters:[1.12.0, 1.13.0[")
36-
api("software.amazon.smithy:smithy-aws-iam-traits:[1.12.0, 1.13.0[")
37-
api("software.amazon.smithy:smithy-protocol-test-traits:[1.12.0, 1.13.0[")
33+
api("software.amazon.smithy:smithy-aws-cloudformation-traits:${rootProject.extra["smithyVersion"]}")
34+
api("software.amazon.smithy:smithy-aws-traits:${rootProject.extra["smithyVersion"]}")
35+
api("software.amazon.smithy:smithy-waiters:${rootProject.extra["smithyVersion"]}")
36+
api("software.amazon.smithy:smithy-aws-iam-traits:${rootProject.extra["smithyVersion"]}")
37+
api("software.amazon.smithy:smithy-protocol-test-traits:${rootProject.extra["smithyVersion"]}")
38+
api("software.amazon.smithy:smithy-model:${rootProject.extra["smithyVersion"]}")
3839
api("software.amazon.smithy.typescript:smithy-typescript-codegen:0.7.0")
3940
}
4041

0 commit comments

Comments
 (0)