File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,18 +47,22 @@ dependencies {
4747// Apply a specific Java toolchain to ease working on different environments.
4848java {
4949 toolchain {
50- languageVersion = JavaLanguageVersion . of(17 )
50+ // Support Java 17 and 25
51+ languageVersion = JavaLanguageVersion . of(
52+ System . getenv(' JAVA_VERSION' )?. toInteger() ?: 25
53+ )
5154 }
55+ // Allow building with Java 17 or 25
56+ sourceCompatibility = JavaVersion . VERSION_17
57+ targetCompatibility = JavaVersion . VERSION_17
5258}
5359
54- // Enable Java 11 compatibility to support NextFlow.
55- tasks {
56- sourceCompatibility = ' 11'
57- targetCompatibility = ' 11'
58- }
59-
60- compileJava {
61- options. release. set(11 )
60+ // Allow compiling with Java 25 if available
61+ tasks. withType(JavaCompile ) {
62+ options. release. set(17 )
63+ if (JavaVersion . current(). isCompatibleWith(JavaVersion . VERSION_21 )) {
64+ options. release. set(25 )
65+ }
6266}
6367
6468test {
You can’t perform that action at this time.
0 commit comments