def cloverInstrDir = file("$buildDir/$cloverSourcesInstrDir")
def classes = "$jalviewDir/$classesDir"
if (clover.equals("true")) {
- clover = true
+ use_clover = true
classes = "$buildDir/$cloverClassesDir"
} else {
- clover = false
+ use_clover = false
classes = "$jalviewDir/$classesDir"
}
}
compileClasspath = files( sourceSets.test.java.outputDir )
- if (clover) {
+ if (use_clover) {
compileClasspath += sourceSets.clover.compileClasspath
} else {
compileClasspath += sourceSets.main.compileClasspath
+ compileClasspath += files(sourceSets.main.java.outputDir)
}
compileClasspath += files( sourceSets.main.resources.srcDirs)
compileClasspath += fileTree(dir: "$jalviewDir/$utilsDir", include: ["**/*.jar"])
// clover bits
dependencies {
- if (clover) {
+ if (use_clover) {
cloverCompile 'org.openclover:clover:4.3.1'
testCompile 'org.openclover:clover:4.3.1'
}
}
compileTestJava {
- if (clover) {
+
+ if (use_clover) {
dependsOn compileCloverJava
classpath += configurations.cloverRuntime
+ } else {
+ classpath += sourceSets.main.runtimeClasspath
}
doFirst {
sourceCompatibility = compile_source_compatibility
//testReportDirName = "test-reports" // note that test workingDir will be $jalviewDir
test {
dependsOn prepare
- if (clover) {
+ dependsOn compileJava
+ if (use_clover) {
dependsOn cloverInstr
}
- print("Running tests " + (clover?"WITH":"WITHOUT") + " clover [clover="+clover+"]\n")
+ print("Running tests " + (use_clover?"WITH":"WITHOUT") + " clover [clover="+use_clover+"]\n")
useTestNG() {
includeGroups testngGroups
private static String modules = null;
+ private static String java_exe = null;
+
public synchronized static String getClassPath()
{
if (scanner == null)
{
modules.concat(mr.getName());
}
+ java_exe = System.getProperty("java.home") + File.separator + "bin"
+ + File.separator + "java";
+
}
while (classpath == null)
{
// Note: JAL-3065 - don't include quotes for lib/* because the arguments are
// not expanded by the shell
String classpath = getClassPath();
- String _cmd = "java " + (withAwt ? "-Djava.awt.headless=true" : "")
+ String _cmd = java_exe + " "
+ + (withAwt ? "-Djava.awt.headless=true" : "")
+ " -classpath " + classpath
+ (modules.length() > 2 ? "--add-modules=\"" + modules + "\""
: "")
Path currentRelativePath = Paths.get("");
String s = currentRelativePath.toAbsolutePath().toString();
System.out.println("Test CWD is " + s);
- System.err.println("Test CWD is " + s);
} catch (Exception q)
{
q.printStackTrace();