TAP5-2588: Make Java 9/10 detection work for 11 too
diff --git a/build.gradle b/build.gradle
index 45872f6..d0db2c5 100755
--- a/build.gradle
+++ b/build.gradle
@@ -116,12 +116,11 @@
binaries "org.antlr:antlr-runtime:3.3", { transitive = false }
}
-def isJava9 = System.properties['java.version'].startsWith('9')
-def isJava10 = System.properties['java.version'].startsWith('10')
+String jdkVersion = System.properties['java.version']
+def jdkMajorVersion = jdkVersion.substring(0, jdkVersion.indexOf(".")) // 1, 9, 10...
subprojects {
- def jdkVersion = System.properties['java.version']
def specifyMaxPermSize = jdkVersion ==~ /1\.[67].+/
version = parent.version
@@ -135,6 +134,8 @@
apply plugin: "java"
apply plugin: "groovy" // mostly for testing
apply plugin: "maven" // for deployment
+ // TODO: replace the "maven" plugin above with the newer "maven-publish"
+
apply plugin: "project-report"
apply plugin: "jacoco"
@@ -193,7 +194,7 @@
systemProperties["java.io.tmpdir"] = temporaryDir.absolutePath
jvmArgs("-Dfile.encoding=UTF-8")
- if (isJava9 || isJava10){
+ if (jdkMajorVersion != "1"){
// TODO: make these regular dependencies instead
jvmArgs += ["--add-modules", "java.xml.ws.annotation,java.xml.bind"]
}