From: Jim Procter Date: Thu, 11 Apr 2019 13:37:58 +0000 (+0100) Subject: JAL-3130 ensure J11 libs/modules are added when building and running test suite X-Git-Tag: Release_2_11_0~17^2~7^2~44 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=e861a8212e4e459be8cc90c27b0e91dc5e081c59;p=jalview.git JAL-3130 ensure J11 libs/modules are added when building and running test suite --- diff --git a/build.gradle b/build.gradle index 4a63af9..d4140bd 100644 --- a/build.gradle +++ b/build.gradle @@ -95,6 +95,26 @@ compileJava { } +compileTestJava { + + doFirst { + if (JAVA_VERSION.equals("1.8")) { + sourceCompatibility = 1.8 + targetCompatibility = 1.8 + } else if (JAVA_VERSION.equals("11")) { + sourceCompatibility = 11 + targetCompatibility = 11 + + options.compilerArgs = [ + '--module-path', sourceSets.modules.compileClasspath.asPath, + '--add-modules', j11modules + ] + } + print ("Setting target compatibility to "+targetCompatibility+"\n") + } + +} + clean { delete sourceSets.main.java.outputDir } @@ -197,11 +217,29 @@ task prepare { test { dependsOn prepare dependsOn compileJava + dependsOn compileTestJava useTestNG { includeGroups testngGroups + preserveOrder true } + workingDir = jalviewDir //systemProperties 'clover.jar' System.properties.clover.jar + if (JAVA_VERSION.equals("1.8")) { + sourceCompatibility = 1.8 + targetCompatibility = 1.8 + } else if (JAVA_VERSION.equals("11")) { + sourceCompatibility = 11 + targetCompatibility = 11 + + jvmArgs += [ + '--module-path', + sourceSets.modules.compileClasspath.asPath, + '--add-modules', + j11modules + ] + } + print ("Setting target compatibility to "+targetCompatibility+"\n") } task buildIndices(type: JavaExec) {