Skip to content

Commit cd30428

Browse files
committed
Pass --release=21 to javac rather than source/target compatibility
1 parent ace4992 commit cd30428

File tree

5 files changed

+10
-15
lines changed

5 files changed

+10
-15
lines changed

gradle/base/dsl-extensions/build.gradle.kts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ plugins {
44
`kotlin-dsl`
55
}
66

7-
java {
8-
sourceCompatibility = JavaVersion.VERSION_21
9-
targetCompatibility = JavaVersion.VERSION_21
7+
tasks.compileJava {
8+
options.release = 21
109
}
1110

1211
kotlin {

gradle/plugins/build-parameters/build.gradle.kts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ plugins {
44

55
group = "junitbuild"
66

7-
java {
8-
sourceCompatibility = JavaVersion.VERSION_21
9-
targetCompatibility = JavaVersion.VERSION_21
7+
tasks.compileJava {
8+
options.release = 21
109
}
1110

1211
buildParameters {

gradle/plugins/code-generator/build.gradle.kts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ dependencies {
1313
implementation(libs.jte)
1414
}
1515

16-
java {
17-
sourceCompatibility = JavaVersion.VERSION_21
18-
targetCompatibility = JavaVersion.VERSION_21
16+
tasks.compileJava {
17+
options.release = 21
1918
}
2019

2120
kotlin {

gradle/plugins/common/build.gradle.kts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@ dependencies {
2121
implementation(libs.plugins.spotless.markerCoordinates)
2222
}
2323

24-
java {
25-
sourceCompatibility = JavaVersion.VERSION_21
26-
targetCompatibility = JavaVersion.VERSION_21
24+
tasks.compileJava {
25+
options.release = 21
2726
}
2827

2928
kotlin {

gradle/plugins/publishing/build.gradle.kts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ configurations.configureEach {
2525
}
2626
}
2727

28-
java {
29-
sourceCompatibility = JavaVersion.VERSION_21
30-
targetCompatibility = JavaVersion.VERSION_21
28+
tasks.compileJava {
29+
options.release = 21
3130
}
3231

3332
kotlin {

0 commit comments

Comments
 (0)