Skip to content

Commit 4e6df5e

Browse files
authored
chore(codegen): move smithy version settings to gradle properties (#4035)
1 parent ad99b66 commit 4e6df5e

File tree

6 files changed

+38
-19
lines changed

6 files changed

+38
-19
lines changed

codegen/build.gradle.kts

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

34-
extra["smithyVersion"] = "[1.25.2,1.26.0["
35-
3634
// The root project doesn't produce a JAR.
3735
tasks["jar"].enabled = false
3836

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,26 @@
1515

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

18+
val smithyVersion: String by project
19+
1820
buildscript {
21+
val smithyVersion: String by project
22+
1923
repositories {
2024
mavenCentral()
2125
}
2226
dependencies {
23-
"classpath"("software.amazon.smithy:smithy-cli:${rootProject.extra["smithyVersion"]}")
27+
"classpath"("software.amazon.smithy:smithy-cli:$smithyVersion")
2428
}
2529
}
2630

2731
plugins {
28-
id("software.amazon.smithy") version "0.6.0"
32+
val smithyGradleVersion: String by project
33+
id("software.amazon.smithy").version(smithyGradleVersion)
2934
}
3035

3136
dependencies {
32-
implementation("software.amazon.smithy:smithy-aws-protocol-tests:${rootProject.extra["smithyVersion"]}")
37+
implementation("software.amazon.smithy:smithy-aws-protocol-tests:$smithyVersion")
3338
implementation(project(":smithy-aws-typescript-codegen"))
3439
}
3540

codegen/gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
smithyVersion=[1.25.0,1.26.0[
2+
smithyGradleVersion=0.6.0

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,26 @@
1515

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

18+
val smithyVersion: String by project
19+
1820
buildscript {
21+
val smithyVersion: String by project
22+
1923
repositories {
2024
mavenCentral()
2125
}
2226
dependencies {
23-
"classpath"("software.amazon.smithy:smithy-cli:${rootProject.extra["smithyVersion"]}")
27+
"classpath"("software.amazon.smithy:smithy-cli:$smithyVersion")
2428
}
2529
}
2630

2731
plugins {
28-
id("software.amazon.smithy") version "0.6.0"
32+
val smithyGradleVersion: String by project
33+
id("software.amazon.smithy").version(smithyGradleVersion)
2934
}
3035

3136
dependencies {
32-
implementation("software.amazon.smithy:smithy-aws-protocol-tests:${rootProject.extra["smithyVersion"]}")
37+
implementation("software.amazon.smithy:smithy-aws-protocol-tests:$smithyVersion")
3338
implementation(project(":smithy-aws-typescript-codegen"))
3439
}
3540

codegen/sdk-codegen/build.gradle.kts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,24 @@ import software.amazon.smithy.aws.traits.ServiceTrait
2121
import java.util.stream.Stream
2222
import kotlin.streams.toList
2323

24+
val smithyVersion: String by project
25+
2426
buildscript {
27+
val smithyVersion: String by project
28+
2529
repositories {
2630
mavenLocal()
2731
mavenCentral()
2832
}
2933
dependencies {
30-
"classpath"("software.amazon.smithy:smithy-cli:${rootProject.extra["smithyVersion"]}")
31-
"classpath"("software.amazon.smithy:smithy-aws-traits:${rootProject.extra["smithyVersion"]}")
34+
"classpath"("software.amazon.smithy:smithy-cli:$smithyVersion")
35+
"classpath"("software.amazon.smithy:smithy-aws-traits:$smithyVersion")
3236
}
3337
}
3438

3539
plugins {
36-
id("software.amazon.smithy") version "0.6.0"
40+
val smithyGradleVersion: String by project
41+
id("software.amazon.smithy").version(smithyGradleVersion)
3742
}
3843

3944
dependencies {

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,27 @@ description = "Generates TypeScript code for AWS protocols from Smithy models"
2020
extra["displayName"] = "Smithy :: AWS :: Typescript :: Codegen"
2121
extra["moduleName"] = "software.amazon.smithy.aws.typescript.codegen"
2222

23+
val smithyVersion: String by project
24+
2325
buildscript {
26+
val smithyVersion: String by project
27+
2428
repositories {
2529
mavenCentral()
2630
}
2731
dependencies {
28-
classpath("software.amazon.smithy:smithy-model:${rootProject.extra["smithyVersion"]}")
32+
classpath("software.amazon.smithy:smithy-model:$smithyVersion")
2933
}
3034
}
3135

3236
dependencies {
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"]}")
39-
api("software.amazon.smithy:smithy-rules-engine:${rootProject.extra["smithyVersion"]}")
37+
api("software.amazon.smithy:smithy-aws-cloudformation-traits:$smithyVersion")
38+
api("software.amazon.smithy:smithy-aws-traits:$smithyVersion")
39+
api("software.amazon.smithy:smithy-waiters:$smithyVersion")
40+
api("software.amazon.smithy:smithy-aws-iam-traits:$smithyVersion")
41+
api("software.amazon.smithy:smithy-protocol-test-traits:$smithyVersion")
42+
api("software.amazon.smithy:smithy-model:$smithyVersion")
43+
api("software.amazon.smithy:smithy-rules-engine:$smithyVersion")
4044
api("software.amazon.smithy.typescript:smithy-typescript-codegen:0.12.0")
4145
}
4246

0 commit comments

Comments
 (0)