From: Jim Procter Date: Tue, 16 Apr 2019 16:36:45 +0000 (+0100) Subject: JAL-3130 refactored ‘clover’ to ‘use_clover’ since clover is an ambiguous property... X-Git-Tag: Release_2_11_0~17^2~7^2~20^2~2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=a3ab8b587ee3a4bc9e334deb14c492d3e3a307d0;p=jalview.git JAL-3130 refactored ‘clover’ to ‘use_clover’ since clover is an ambiguous property - still offer -Pclover=true as command line switch to enable clover coverage --- diff --git a/build.gradle b/build.gradle index 291d718..c34128e 100644 --- a/build.gradle +++ b/build.gradle @@ -28,10 +28,10 @@ mainClassName = launcherClass 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" } @@ -97,10 +97,11 @@ sourceSets { } 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"]) @@ -116,7 +117,7 @@ sourceSets { // clover bits dependencies { - if (clover) { + if (use_clover) { cloverCompile 'org.openclover:clover:4.3.1' testCompile 'org.openclover:clover:4.3.1' } @@ -189,9 +190,12 @@ compileJava { } compileTestJava { - if (clover) { + + if (use_clover) { dependsOn compileCloverJava classpath += configurations.cloverRuntime + } else { + classpath += sourceSets.main.runtimeClasspath } doFirst { if (JAVA_VERSION.equals("1.8")) { @@ -334,10 +338,11 @@ task prepare { //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 diff --git a/gradle.properties b/gradle.properties index 15d1e1d..6c5c1f1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -26,6 +26,7 @@ sourceDir = src schemaDir = schemas classesDir = classes clover = false +use_clover = false cloverClassesDir = clover-classes cloverSourcesInstrDir = sources-instr packageDir = dist