Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump JDK baseline to 17 #4249

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/actions/setup-test-jdk/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,10 @@ runs:
check-latest: true
- shell: bash
run: echo "JDK8=$JAVA_HOME" >> $GITHUB_ENV
- uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4
with:
distribution: ${{ inputs.distribution }}
java-version: 17
check-latest: true
- shell: bash
run: echo "JDK17=$JAVA_HOME" >> $GITHUB_ENV
4 changes: 2 additions & 2 deletions documentation/documentation.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ val modularProjects: List<Project> by rootProject
modularProjects.forEach { evaluationDependsOn(it.path) }

javaLibrary {
mainJavaVersion = JavaVersion.VERSION_1_8
testJavaVersion = JavaVersion.VERSION_1_8
mainJavaVersion = JavaVersion.VERSION_17
testJavaVersion = JavaVersion.VERSION_17
}

val apiReport = configurations.dependencyScope("apiReport")
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ org.gradle.jvmargs=-Xmx1g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryEr
org.gradle.caching=true
org.gradle.parallel=true
org.gradle.configuration-cache.parallel=true
org.gradle.java.installations.fromEnv=JDK8,JDK18,JDK19,JDK20,JDK21,JDK22,JDK23,JDK24
org.gradle.java.installations.fromEnv=JDK8,JDK17,JDK21,JDK23,JDK24,JDK25
org.gradle.kotlin.dsl.allWarningsAsErrors=true

# Test Distribution
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import org.gradle.api.JavaVersion

open class JavaLibraryExtension {
var mainJavaVersion: JavaVersion = JavaVersion.VERSION_1_8
var mainJavaVersion: JavaVersion = JavaVersion.VERSION_17
var testJavaVersion: JavaVersion = JavaVersion.VERSION_21
var configureRelease: Boolean = true
}
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,8 @@ val compileModule by tasks.registering(JavaCompile::class) {
enabled = project in modularProjects
source = fileTree(combinedModuleSourceDir).builtBy(prepareModuleSourceDir)
destinationDirectory = moduleOutputDir
sourceCompatibility = "9"
targetCompatibility = "9"
classpath = files()
options.release = 9
options.release = 17
options.compilerArgs.addAll(listOf(
// Suppress warnings for automatic modules: org.apiguardian.api, org.opentest4j
"-Xlint:all,-requires-automatic,-requires-transitive-automatic",
Expand Down Expand Up @@ -262,17 +260,14 @@ tasks.withType<JavaCompile>().configureEach {
}

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

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

This file was deleted.

28 changes: 0 additions & 28 deletions junit-platform-commons/junit-platform-commons.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import junitbuild.java.UpdateJarAction

plugins {
id("junitbuild.java-library-conventions")
id("junitbuild.java-multi-release-sources")
id("junitbuild.native-image-properties")
`java-test-fixtures`
}
Expand All @@ -14,28 +11,3 @@ dependencies {

compileOnlyApi(libs.apiguardian)
}

tasks.jar {
val release9ClassesDir = sourceSets.mainRelease9.get().output.classesDirs.singleFile
inputs.dir(release9ClassesDir).withPathSensitivity(PathSensitivity.RELATIVE)
doLast(objects.newInstance(UpdateJarAction::class).apply {
javaLauncher = javaToolchains.launcherFor(java.toolchain)
args.addAll(
"--file", archiveFile.get().asFile.absolutePath,
"--release", "9",
"-C", release9ClassesDir.absolutePath, "."
)
})
}

tasks.codeCoverageClassesJar {
exclude("org/junit/platform/commons/util/ModuleUtils.class")
exclude("org/junit/platform/commons/util/PackageNameUtils.class")
exclude("org/junit/platform/commons/util/ServiceLoaderUtils.class")
}

eclipse {
classpath {
sourceSets -= project.sourceSets.mainRelease9.get()
}
}
Loading
Loading