From 108b55158657c77c8fc4c5e6a460161dde47e225 Mon Sep 17 00:00:00 2001 From: Kevin Stich Date: Wed, 12 Oct 2022 10:25:52 -0700 Subject: [PATCH] Move Smithy version settings to gradle properties (#611) --- build.gradle.kts | 2 -- gradle.properties | 2 ++ smithy-typescript-codegen-test/build.gradle.kts | 15 ++++++++++----- smithy-typescript-codegen/build.gradle.kts | 15 +++++++++------ 4 files changed, 21 insertions(+), 13 deletions(-) create mode 100644 gradle.properties diff --git a/build.gradle.kts b/build.gradle.kts index 9b483c08e2a..a86bf05935b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -28,8 +28,6 @@ allprojects { version = "0.12.0" } -extra["smithyVersion"] = "[1.25.0,1.26.0[" - // The root project doesn't produce a JAR. tasks["jar"].enabled = false diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 00000000000..4ecbe42ddfc --- /dev/null +++ b/gradle.properties @@ -0,0 +1,2 @@ +smithyVersion=[1.25.0,1.26.0[ +smithyGradleVersion=0.6.0 diff --git a/smithy-typescript-codegen-test/build.gradle.kts b/smithy-typescript-codegen-test/build.gradle.kts index d991b01a785..afe9982550d 100644 --- a/smithy-typescript-codegen-test/build.gradle.kts +++ b/smithy-typescript-codegen-test/build.gradle.kts @@ -18,18 +18,23 @@ extra["moduleName"] = "software.amazon.smithy.typescript.codegen.test" tasks["jar"].enabled = false +val smithyVersion: String by project + buildscript { + val smithyVersion: String by project + repositories { mavenCentral() } dependencies { - "classpath"("software.amazon.smithy:smithy-cli:${rootProject.extra["smithyVersion"]}") + "classpath"("software.amazon.smithy:smithy-cli:$smithyVersion") } } - plugins { - id("software.amazon.smithy").version("0.6.0") + val smithyGradleVersion: String by project + + id("software.amazon.smithy").version(smithyGradleVersion) } repositories { @@ -39,6 +44,6 @@ repositories { dependencies { implementation(project(":smithy-typescript-codegen")) - implementation("software.amazon.smithy:smithy-waiters:${rootProject.extra["smithyVersion"]}") - implementation("software.amazon.smithy:smithy-protocol-test-traits:${rootProject.extra["smithyVersion"]}") + implementation("software.amazon.smithy:smithy-waiters:$smithyVersion") + implementation("software.amazon.smithy:smithy-protocol-test-traits:$smithyVersion") } diff --git a/smithy-typescript-codegen/build.gradle.kts b/smithy-typescript-codegen/build.gradle.kts index 587d4a50c1a..8f26bc6d566 100644 --- a/smithy-typescript-codegen/build.gradle.kts +++ b/smithy-typescript-codegen/build.gradle.kts @@ -17,19 +17,22 @@ description = "Generates TypeScript code from Smithy models" extra["displayName"] = "Smithy :: Typescript :: Codegen" extra["moduleName"] = "software.amazon.smithy.typescript.codegen" +val smithyVersion: String by project + buildscript { + val smithyVersion: String by project + repositories { mavenCentral() } dependencies { - "classpath"("software.amazon.smithy:smithy-cli:${rootProject.extra["smithyVersion"]}") + "classpath"("software.amazon.smithy:smithy-cli:$smithyVersion") } } - dependencies { - api("software.amazon.smithy:smithy-codegen-core:${rootProject.extra["smithyVersion"]}") - api("software.amazon.smithy:smithy-rules-engine:${rootProject.extra["smithyVersion"]}") - api("software.amazon.smithy:smithy-waiters:${rootProject.extra["smithyVersion"]}") - implementation("software.amazon.smithy:smithy-protocol-test-traits:${rootProject.extra["smithyVersion"]}") + api("software.amazon.smithy:smithy-codegen-core:$smithyVersion") + api("software.amazon.smithy:smithy-rules-engine:$smithyVersion") + api("software.amazon.smithy:smithy-waiters:$smithyVersion") + implementation("software.amazon.smithy:smithy-protocol-test-traits:$smithyVersion") }