mirror of
https://github.com/octoleo/plantuml.git
synced 2024-11-21 20:45:10 +00:00
gradle, permit 'gradle test' with java8
This commit is contained in:
parent
b438f6561c
commit
1bb80c929c
@ -1,4 +1,10 @@
|
||||
val javacRelease: String by project
|
||||
// permits to start the build setting the javac release parameter, no parameter means build for java8:
|
||||
// gradle clean build -x javaDoc -PjavacRelease=8
|
||||
// gradle clean build -x javaDoc -PjavacRelease=17
|
||||
// also supported is to build first, with java17, then switch the java version, and run the test with java8:
|
||||
// gradle clean build -x javaDoc -x test
|
||||
// gradle test
|
||||
val javacRelease = (project.findProperty("javacRelease") ?: "8") as String
|
||||
|
||||
plugins {
|
||||
java
|
||||
@ -52,7 +58,11 @@ sourceSets {
|
||||
}
|
||||
|
||||
tasks.compileJava {
|
||||
options.release.set(Integer.parseInt(javacRelease))
|
||||
if (JavaVersion.current().isJava8) {
|
||||
java.targetCompatibility = JavaVersion.VERSION_1_8
|
||||
} else {
|
||||
options.release.set(Integer.parseInt(javacRelease))
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<Jar> {
|
||||
|
@ -1,2 +1 @@
|
||||
javacRelease = 8
|
||||
version = 1.2022.1-SNAPSHOT
|
||||
|
Loading…
Reference in New Issue
Block a user