From e861a8212e4e459be8cc90c27b0e91dc5e081c59 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Thu, 11 Apr 2019 14:37:58 +0100 Subject: [PATCH] JAL-3130 ensure J11 libs/modules are added when building and running test suite --- build.gradle | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) 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) { -- 1.7.10.2