Skip to content

Commit

Permalink
Fix spotless on JDK21
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenbaker committed Dec 11, 2024
1 parent 19efe8d commit 99536a4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
9 changes: 7 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@ repositories {
dependencies {
// Plugins used by buildSrc scripts
implementation(libs.spotbugs)
implementation(libs.spotless)
// https://github.com/diffplug/spotless/issues/1819
implementation(
when {
JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_11) -> libs.spotless.jdk11
else -> libs.spotless.jdk8
}
)
implementation(libs.jmh)

// https://github.com/gradle/gradle/issues/15383
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
}
6 changes: 4 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ junit5 = "5.11.3"
hamcrest = "3.0"
jmh = "0.6.6"
spotbugs = "6.0.22"
spotless = "6.7.1"
spotless = "6.13.0"
spotless-jdk11 = "6.25.0"
smithy-gradle = "1.1.0"
assertj = "3.26.3"
prettier4j = "0.1.1"
Expand Down Expand Up @@ -47,7 +48,8 @@ apiguardian-api = { module = "org.apiguardian:apiguardian-api", version.ref = "a

# plugin artifacts for buildsrc plugins
spotbugs = { module = "com.github.spotbugs.snom:spotbugs-gradle-plugin", version.ref = "spotbugs" }
spotless = { module = "com.diffplug.spotless:spotless-plugin-gradle", version.ref = "spotless" }
spotless-jdk8 = { module = "com.diffplug.spotless:spotless-plugin-gradle", version.ref = "spotless" }
spotless-jdk11 = { module = "com.diffplug.spotless:spotless-plugin-gradle", version.ref = "spotless-jdk11" }
jmh = { module = "me.champeau.jmh:jmh-gradle-plugin", version.ref = "jmh" }

[plugins]
Expand Down
2 changes: 1 addition & 1 deletion smithy-cli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ if (project.hasProperty("release.cli")) {
replacements = mapOf(
"osx" to "darwin",
"aarch_64" to "aarch64",
"windows_x86_64" to "windows_x64"
"windows_x86_64" to "windows_x64",
)
}

Expand Down

0 comments on commit 99536a4

Please sign in to comment.