Skip to content

Commit 59d3b43

Browse files
marcphilippsormuras
andcommitted
Bump JDK baseline to 17
Co-authored-by: Christian Stein <[email protected]>
1 parent cd1d14f commit 59d3b43

File tree

49 files changed

+281
-830
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+281
-830
lines changed

.github/actions/setup-test-jdk/action.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ runs:
1111
- uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
1212
with:
1313
distribution: ${{ inputs.distribution }}
14-
java-version: 8
14+
java-version: 17
1515
check-latest: true
1616
- shell: bash
17-
run: echo "JDK8=$JAVA_HOME" >> $GITHUB_ENV
17+
run: echo "JDK17=$JAVA_HOME" >> $GITHUB_ENV

documentation/documentation.gradle.kts

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ val modularProjects: List<Project> by rootProject
2626
modularProjects.forEach { evaluationDependsOn(it.path) }
2727

2828
javaLibrary {
29-
mainJavaVersion = JavaVersion.VERSION_1_8
30-
testJavaVersion = JavaVersion.VERSION_1_8
29+
mainJavaVersion = JavaVersion.VERSION_17
30+
testJavaVersion = JavaVersion.VERSION_17
3131
}
3232

3333
val apiReport = configurations.dependencyScope("apiReport")

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ org.gradle.jvmargs=-Xmx1g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryEr
2020
org.gradle.caching=true
2121
org.gradle.parallel=true
2222
org.gradle.configuration-cache.parallel=true
23-
org.gradle.java.installations.fromEnv=JDK8,JDK18,JDK19,JDK20,JDK21,JDK22,JDK23,JDK24
23+
org.gradle.java.installations.fromEnv=JDK17,JDK21,JDK23,JDK24,JDK25
2424
org.gradle.kotlin.dsl.allWarningsAsErrors=true
2525

2626
# Test Distribution
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import org.gradle.api.JavaVersion
22

33
open class JavaLibraryExtension {
4-
var mainJavaVersion: JavaVersion = JavaVersion.VERSION_1_8
4+
var mainJavaVersion: JavaVersion = JavaVersion.VERSION_17
55
var testJavaVersion: JavaVersion = JavaVersion.VERSION_21
66
var configureRelease: Boolean = true
77
}

gradle/plugins/common/src/main/kotlin/junitbuild.java-library-conventions.gradle.kts

+1-6
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,8 @@ val compileModule by tasks.registering(JavaCompile::class) {
184184
enabled = project in modularProjects
185185
source = fileTree(combinedModuleSourceDir).builtBy(prepareModuleSourceDir)
186186
destinationDirectory = moduleOutputDir
187-
sourceCompatibility = "9"
188-
targetCompatibility = "9"
189187
classpath = files()
190-
options.release = 9
188+
options.release = 17
191189
options.compilerArgs.addAll(listOf(
192190
// Suppress warnings for automatic modules: org.apiguardian.api, org.opentest4j
193191
"-Xlint:all,-requires-automatic,-requires-transitive-automatic",
@@ -262,17 +260,14 @@ tasks.withType<JavaCompile>().configureEach {
262260
}
263261

264262
tasks.compileJava {
265-
// See: https://docs.oracle.com/en/java/javase/12/tools/javac.html
266263
options.compilerArgs.addAll(listOf(
267264
"-Xlint:all", // Enables all recommended warnings.
268265
"-Werror", // Terminates compilation when warnings occur.
269-
// Required for compatibility with Java 8's reflection APIs (see https://github.com/junit-team/junit5/issues/3797).
270266
"-parameters", // Generates metadata for reflection on method parameters.
271267
))
272268
}
273269

274270
tasks.compileTestJava {
275-
// See: https://docs.oracle.com/en/java/javase/12/tools/javac.html
276271
options.compilerArgs.addAll(listOf(
277272
"-Xlint", // Enables all recommended warnings.
278273
"-Xlint:-overrides", // Disables "method overrides" warnings.

gradle/plugins/common/src/main/kotlin/junitbuild.java-multi-release-sources.gradle.kts

-45
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
import junitbuild.java.UpdateJarAction
2-
31
plugins {
42
id("junitbuild.java-library-conventions")
5-
id("junitbuild.java-multi-release-sources")
63
id("junitbuild.native-image-properties")
74
`java-test-fixtures`
85
}
@@ -14,28 +11,3 @@ dependencies {
1411

1512
compileOnlyApi(libs.apiguardian)
1613
}
17-
18-
tasks.jar {
19-
val release9ClassesDir = sourceSets.mainRelease9.get().output.classesDirs.singleFile
20-
inputs.dir(release9ClassesDir).withPathSensitivity(PathSensitivity.RELATIVE)
21-
doLast(objects.newInstance(UpdateJarAction::class).apply {
22-
javaLauncher = javaToolchains.launcherFor(java.toolchain)
23-
args.addAll(
24-
"--file", archiveFile.get().asFile.absolutePath,
25-
"--release", "9",
26-
"-C", release9ClassesDir.absolutePath, "."
27-
)
28-
})
29-
}
30-
31-
tasks.codeCoverageClassesJar {
32-
exclude("org/junit/platform/commons/util/ModuleUtils.class")
33-
exclude("org/junit/platform/commons/util/PackageNameUtils.class")
34-
exclude("org/junit/platform/commons/util/ServiceLoaderUtils.class")
35-
}
36-
37-
eclipse {
38-
classpath {
39-
sourceSets -= project.sourceSets.mainRelease9.get()
40-
}
41-
}

0 commit comments

Comments
 (0)