From a3ab8b587ee3a4bc9e334deb14c492d3e3a307d0 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Tue, 16 Apr 2019 17:36:45 +0100 Subject: [PATCH] =?utf8?q?JAL-3130=20refactored=20=E2=80=98clover=E2=80=99=20?= =?utf8?q?to=20=E2=80=98use=5Fclover=E2=80=99=20since=20clover=20is=20an=20a?= =?utf8?q?mbiguous=20property=20-=20still=20offer=20-Pclover=3Dtrue=20as=20c?= =?utf8?q?ommand=20line=20switch=20to=20enable=20clover=20coverage?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- build.gradle | 19 ++++++++++++------- gradle.properties | 1 + 2 files changed, 13 insertions(+), 7 deletions(-) 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 -- 1.7.10.2