Skip to content

Commit 58c210d

Browse files
committed
run tests with jdk 17
1 parent 00e352c commit 58c210d

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

build.gradle

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,20 @@ tasks.named("dependencyUpdates").configure {
135135
}
136136
}
137137

138-
tasks.withType(Test) {
138+
tasks.withType(Test).configureEach {
139+
jvmArgs(
140+
"--add-exports", "jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
141+
"--add-exports", "jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED",
142+
"--add-exports", "jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED",
143+
"--add-exports", "jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED",
144+
"--add-exports", "jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED",
145+
"--add-exports", "jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED"
146+
)
147+
148+
javaLauncher.set(javaToolchains.launcherFor {
149+
languageVersion.set(JavaLanguageVersion.of(libs.versions.test.jdk.get()))
150+
})
151+
139152
finalizedBy jacocoTestReport
140153
}
141154

gradle/libs.versions.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
kotlin = "1.8.22"
33
build-jdk = "11"
44
target-jdk = "11"
5+
test-jdk = "17"
56

67
junit = "5.9.3"
78
jacoco = "0.8.7"

0 commit comments

Comments
 (0)