Skip to content

Commit

Permalink
fix(codegen): use specific Smithy version (#3011)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
adamthom-amzn authored Nov 11, 2021
1 parent 3bc91c0 commit 6cdee41
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 9 deletions.
2 changes: 2 additions & 0 deletions codegen/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ allprojects {
version = "0.7.0"
}

extra["smithyVersion"] = "[1.12.0,1.13.0["

// The root project doesn't produce a JAR.
tasks["jar"].enabled = false

Expand Down
11 changes: 10 additions & 1 deletion codegen/generic-client-test-codegen/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,21 @@

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

buildscript {
repositories {
mavenCentral()
}
dependencies {
"classpath"("software.amazon.smithy:smithy-cli:${rootProject.extra["smithyVersion"]}")
}
}

plugins {
id("software.amazon.smithy") version "0.5.3"
}

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

Expand Down
11 changes: 10 additions & 1 deletion codegen/protocol-test-codegen/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,21 @@

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

buildscript {
repositories {
mavenCentral()
}
dependencies {
"classpath"("software.amazon.smithy:smithy-cli:1.12.+")
}
}

plugins {
id("software.amazon.smithy") version "0.5.3"
}

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

Expand Down
3 changes: 2 additions & 1 deletion codegen/sdk-codegen/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ buildscript {
mavenCentral()
}
dependencies {
"classpath"("software.amazon.smithy:smithy-aws-traits:[1.12.0,1.13.0[")
"classpath"("software.amazon.smithy:smithy-cli:${rootProject.extra["smithyVersion"]}")
"classpath"("software.amazon.smithy:smithy-aws-traits:${rootProject.extra["smithyVersion"]}")
}
}

Expand Down
13 changes: 7 additions & 6 deletions codegen/smithy-aws-typescript-codegen/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("software.amazon.smithy:smithy-model:[1.12.0, 1.13.0[")
classpath("software.amazon.smithy:smithy-model:${rootProject.extra["smithyVersion"]}")
}
}

dependencies {
api("software.amazon.smithy:smithy-aws-cloudformation-traits:[1.12.0, 1.13.0[")
api("software.amazon.smithy:smithy-aws-traits:[1.12.0, 1.13.0[")
api("software.amazon.smithy:smithy-waiters:[1.12.0, 1.13.0[")
api("software.amazon.smithy:smithy-aws-iam-traits:[1.12.0, 1.13.0[")
api("software.amazon.smithy:smithy-protocol-test-traits:[1.12.0, 1.13.0[")
api("software.amazon.smithy:smithy-aws-cloudformation-traits:${rootProject.extra["smithyVersion"]}")
api("software.amazon.smithy:smithy-aws-traits:${rootProject.extra["smithyVersion"]}")
api("software.amazon.smithy:smithy-waiters:${rootProject.extra["smithyVersion"]}")
api("software.amazon.smithy:smithy-aws-iam-traits:${rootProject.extra["smithyVersion"]}")
api("software.amazon.smithy:smithy-protocol-test-traits:${rootProject.extra["smithyVersion"]}")
api("software.amazon.smithy:smithy-model:${rootProject.extra["smithyVersion"]}")
api("software.amazon.smithy.typescript:smithy-typescript-codegen:0.7.0")
}

Expand Down

0 comments on commit 6cdee41

Please sign in to comment.