JAL-3541 trying out previous cloverReport task
authorBen Soares <bsoares@dundee.ac.uk>
Tue, 17 Mar 2020 11:28:17 +0000 (11:28 +0000)
committerBen Soares <bsoares@dundee.ac.uk>
Tue, 17 Mar 2020 11:28:17 +0000 (11:28 +0000)
build.gradle

index 3683195..8dd6187 100644 (file)
@@ -569,33 +569,6 @@ task cloverInstr() {
 }
 
 
-task cloverReportHTML (type: JavaExec) {
-    inputs.dir "${buildDir}/clover"
-    outputs.dir "${reportsDir}/clover"
-
-    classpath configurations.cloverRuntime
-    maxHeapSize "${cloverReportJVMHeap}"
-    jvmArgs += "${cloverReportJVMArgs}"
-    main = "com.atlassian.clover.reporters.html.HtmlReporter"
-    args  "--initstring", "${buildDir}/clover/clover.db", "-o", "${reportsDir}/clover"
-    "${cloverReportHTMLOptions}".split(",").each {
-      args+= it.trim()
-      }
-}
-
-task cloverReportXML (type: JavaExec) {
-    inputs.dir "${buildDir}/clover"
-    outputs.dir "${reportsDir}/clover"
-    maxHeapSize "${cloverReportJVMHeap}"
-    jvmArgs "${cloverReportJVMArgs}"
-    classpath configurations.cloverRuntime
-    main = "com.atlassian.clover.reporters.xml.XMLReporter"
-    args  "--initstring", "${buildDir}/clover/clover.db", "-o", "${reportsDir}/clover/clover.xml"
-    
-    "${cloverReportXMLOptions}".split(",").each {
-      args+= it.trim()
-      }
-}
 task cloverReport {
   group = "Verification"
     description = "Creates the Clover report"
@@ -604,8 +577,17 @@ task cloverReport {
     onlyIf {
       file("${buildDir}/clover/clover.db").exists()
     }
-    dependsOn cloverReportXML
-    dependsOn cloverReportHTML
+  doFirst {
+    def argsList = ["--initstring", "${buildDir}/clover/clover.db",
+    "-o", "${reportsDir}/clover"]
+    String[] args = argsList.toArray()
+    com.atlassian.clover.reporters.html.HtmlReporter.runReport(args)
+
+    // and generate ${reportsDir}/clover/clover.xml
+    args = ["--initstring", "${buildDir}/clover/clover.db",
+    "-o", "${reportsDir}/clover/clover.xml"].toArray()
+    com.atlassian.clover.reporters.xml.XMLReporter.runReport(args)
+  }
 }
 // end clover bits