-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Java 21 support for running tests (#622)
This commit adds a Gradle property 'testToolchain' that when set will configure the Java toolchain plugin accordingly. Additionally: ------------- * Replace the custom toolchain plugin with the vanilla one provided by Gradle * Move the Java conventions from Java plugin to Groovy script * [CI] Add Java 21 to check-samples.yml
- Loading branch information
Showing
7 changed files
with
37 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 0 additions & 56 deletions
56
buildSrc/src/main/java/org/springframework/pulsar/gradle/toolchain/ToolchainExtension.java
This file was deleted.
Oops, something went wrong.
81 changes: 0 additions & 81 deletions
81
buildSrc/src/main/java/org/springframework/pulsar/gradle/toolchain/ToolchainPlugin.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
def toolchainVersion() { | ||
if (project.hasProperty('testToolchain')) { | ||
return project.property('testToolchain').toString().toInteger() | ||
} | ||
return 17 | ||
} | ||
|
||
project.afterEvaluate { | ||
subprojects { subproject -> | ||
afterEvaluate { | ||
if (subproject.plugins.hasPlugin(JavaPlugin.class)) { | ||
java { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(toolchainVersion()) | ||
} | ||
} | ||
tasks.withType(JavaCompile).configureEach { | ||
options.encoding = "UTF-8" | ||
options.compilerArgs.add("-parameters") | ||
options.compilerArgs.addAll(["-Werror", "-Xlint:unchecked", "-Xlint:deprecation", "-Xlint:rawtypes", "-Xlint:varargs"]); | ||
options.release.set(17) | ||
} | ||
} | ||
} | ||
} | ||
} |