Skip to content

Commit b446509

Browse files
committed
fixed java 8 test cases
1 parent 61ed925 commit b446509

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

lib/build.gradle

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,23 @@ compileTestJava {
134134
options.compilerArgs = ["-Xlint:deprecation"]
135135
}
136136

137-
//def testJava8 = tasks.register('testJava8', Test) {
138-
// description = 'Runs unit tests on Java 8.'
139-
// group = 'verification'
140-
//
141-
// javaLauncher.set(javaToolchains.launcherFor {
142-
// languageVersion = JavaLanguageVersion.of(8)
143-
// })
144-
// shouldRunAfter(tasks.named('test'))
145-
//}
137+
def testJava8 = tasks.register('testJava8', Test) {
138+
description = 'Runs unit tests on Java 8.'
139+
group = 'verification'
140+
141+
javaLauncher.set(javaToolchains.launcherFor {
142+
languageVersion = JavaLanguageVersion.of(8)
143+
})
144+
shouldRunAfter(tasks.named('test'))
145+
146+
doFirst {
147+
tasks.compileJava.options.release.set(8)
148+
}
149+
150+
doLast {
151+
tasks.compileJava.options.release.set(11)
152+
}
153+
}
146154

147155
def testJava17 = tasks.register('testJava17', Test) {
148156
description = 'Runs unit tests on Java 17.'

0 commit comments

Comments
 (0)