Skip to content

Commit

Permalink
Use gradle.properties for gradle plugin version (#71)
Browse files Browse the repository at this point in the history
Use gradle.properties to set gradle plugin version.
  • Loading branch information
hpmellema authored Feb 14, 2024
1 parent 9a166d9 commit a8f14cf
Show file tree
Hide file tree
Showing 24 changed files with 68 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/update-smithy-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
id: fetch-latest
run: |
echo "latestSmithy=$( \
curl -sL https://api.github.com/repos/awslabs/smithy/releases/latest | \
curl -sL https://api.github.com/repos/smithy-lang/smithy/releases/latest | \
jq -r '.tag_name')" >> $GITHUB_OUTPUT
- name: Get current versions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description = "A package used to define an annotation trait"
plugins {
`java-library`
id("com.github.spotbugs").version("4.7.1")
id("software.amazon.smithy.gradle.smithy-jar").version("0.10.0")
id("software.amazon.smithy.gradle.smithy-jar")
}

java {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
rootProject.name = "custom-annotation-trait"

pluginManagement {
val smithyGradleVersion: String by settings
plugins {
id("software.amazon.smithy.gradle.smithy-jar").version(smithyGradleVersion)
}

repositories {
mavenLocal()
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion custom-trait-examples/custom-string-trait/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description = "Package for a custom Smithy string trait"
plugins {
`java-library`
id("com.github.spotbugs").version("4.7.3")
id("software.amazon.smithy.gradle.smithy-jar").version("0.10.0")
id("software.amazon.smithy.gradle.smithy-jar")
}

java {
Expand Down
5 changes: 5 additions & 0 deletions custom-trait-examples/custom-string-trait/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
rootProject.name = "custom-string-trait"

pluginManagement {
val smithyGradleVersion: String by settings
plugins {
id("software.amazon.smithy.gradle.smithy-jar").version(smithyGradleVersion)
}

repositories {
mavenLocal()
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description = "Custom Smithy structure trait with multiple inputs"
plugins {
`java-library`
id("com.github.spotbugs").version("4.7.3")
id("software.amazon.smithy.gradle.smithy-jar").version("0.10.0")
id("software.amazon.smithy.gradle.smithy-jar")
}

java {
Expand Down
7 changes: 6 additions & 1 deletion custom-trait-examples/custom-structure-trait/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@

pluginManagement {
val smithyGradleVersion: String by settings
plugins {
id("software.amazon.smithy.gradle.smithy-jar").version(smithyGradleVersion)
}

repositories {
mavenLocal()
mavenCentral()
gradlePluginPortal()
}
}

rootProject.name = "custom-structure-trait"
rootProject.name = "custom-structure-trait"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id("java-library")
id("software.amazon.smithy.gradle.smithy-jar").version("0.10.0")
`java-library`
id("software.amazon.smithy.gradle.smithy-jar")
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

plugins {
id("java-library")
id("software.amazon.smithy.gradle.smithy-jar").version("0.10.0")
`java-library`
id("software.amazon.smithy.gradle.smithy-jar")
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

plugins {
id("java-library")
id("software.amazon.smithy.gradle.smithy-jar").version("0.10.0")
`java-library`
id("software.amazon.smithy.gradle.smithy-jar")
}

// The test project doesn't produce a JAR.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
description = "A package used to share a common linting configuration between smithy projects"

plugins {
id("java-library")
id("software.amazon.smithy.gradle.smithy-jar").version("0.10.0")
`java-library`
id("software.amazon.smithy.gradle.smithy-jar")
}

repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
rootProject.name = "common-linting-configuration"

pluginManagement {
val smithyGradleVersion: String by settings
plugins {
id("software.amazon.smithy.gradle.smithy-jar").version(smithyGradleVersion)
}

repositories {
mavenLocal()
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description = "Creates a custom Smithy model validator"
plugins {
`java-library`
id("com.github.spotbugs").version("4.7.3")
id("software.amazon.smithy.gradle.smithy-jar").version("0.10.0")
id("software.amazon.smithy.gradle.smithy-jar")
}

java {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
rootProject.name = "custom-validator"

pluginManagement {
val smithyGradleVersion: String by settings
plugins {
id("software.amazon.smithy.gradle.smithy-jar").version(smithyGradleVersion)
}

repositories {
mavenLocal()
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

plugins {
id("java-library")
id("software.amazon.smithy.gradle.smithy-jar").version("0.10.0")
id("software.amazon.smithy.gradle.smithy-jar")
}

// The test project doesn't produce a JAR.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

plugins {
id("java-library")
id("software.amazon.smithy.gradle.smithy-jar").version("0.10.0")
`java-library`
id("software.amazon.smithy.gradle.smithy-jar")
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

plugins {
id("java-library")
id("software.amazon.smithy.gradle.smithy-jar").version("0.10.0")
`java-library`
id("software.amazon.smithy.gradle.smithy-jar")
}


Expand Down
4 changes: 2 additions & 2 deletions quickstart-examples/quickstart-gradle/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id("java-library")
id("software.amazon.smithy.gradle.smithy-jar").version("0.10.0")
`java-library`
id("software.amazon.smithy.gradle.smithy-jar")
}

repositories {
Expand Down
1 change: 1 addition & 0 deletions quickstart-examples/quickstart-gradle/gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
smithyVersion=1.44.0
smithyGradleVersion=0.10.0
7 changes: 6 additions & 1 deletion quickstart-examples/quickstart-gradle/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@

pluginManagement {
val smithyGradleVersion: String by settings
plugins {
id("software.amazon.smithy.gradle.smithy-jar").version(smithyGradleVersion)
}

repositories {
mavenLocal()
mavenCentral()
gradlePluginPortal()
}
}

rootProject.name = "quickstart-gradle"
rootProject.name = "quickstart-gradle"
6 changes: 6 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@

pluginManagement {
val smithyGradleVersion: String by settings
plugins {
id("software.amazon.smithy.gradle.smithy-jar").version(smithyGradleVersion)
id("software.amazon.smithy.gradle.smithy-base").version(smithyGradleVersion)
}

repositories {
mavenLocal()
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion shared-model-examples/common-shapes/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description = "A package used to share common shapes between smithy projects"

plugins {
`java-library`
id("software.amazon.smithy.gradle.smithy-jar").version("0.10.0")
id("software.amazon.smithy.gradle.smithy-jar")
}

repositories {
Expand Down
6 changes: 6 additions & 0 deletions shared-model-examples/common-shapes/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
rootProject.name = "common-shapes"

pluginManagement {
val smithyGradleVersion: String by settings

plugins {
id("software.amazon.smithy.gradle.smithy-jar").version(smithyGradleVersion)
}

repositories {
mavenLocal()
mavenCentral()
Expand Down
4 changes: 2 additions & 2 deletions shared-model-examples/integ/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id("java-library")
id("software.amazon.smithy.gradle.smithy-jar").version("0.10.0")
`java-library`
id("software.amazon.smithy.gradle.smithy-jar")
}

// The test project doesn't produce a JAR.
Expand Down

0 comments on commit a8f14cf

Please sign in to comment.