Fix wrong toolchain configuration for java17 tests
This commit is contained in:
parent
d2cca544c2
commit
f1c08e8e97
|
@ -230,6 +230,9 @@ if ( gradle.ext.javaVersions.test.release.asInt() >= 17 ) {
|
|||
|
||||
// For the new source set, we need to configure the source and target version to 17
|
||||
compileTestJava17Java {
|
||||
javaCompiler = javaToolchains.compilerFor {
|
||||
languageVersion = gradle.ext.javaVersions.test.compiler
|
||||
}
|
||||
sourceCompatibility = 17
|
||||
targetCompatibility = 17
|
||||
// We also depend on the main test resources
|
||||
|
@ -250,6 +253,9 @@ if ( gradle.ext.javaVersions.test.release.asInt() >= 17 ) {
|
|||
|
||||
// We execute the Java 17 tests in a custom test task
|
||||
task java17Test(type: Test) {
|
||||
javaLauncher = javaToolchains.launcherFor {
|
||||
languageVersion = gradle.ext.javaVersions.test.launcher
|
||||
}
|
||||
useJUnitPlatform()
|
||||
testClassesDirs = sourceSets.testJava17.output.classesDirs
|
||||
classpath = sourceSets.testJava17.runtimeClasspath
|
||||
|
|
Loading…
Reference in New Issue