From: Jim Procter Date: Tue, 25 Feb 2020 17:10:19 +0000 (+0000) Subject: JAL-3541 use javaExec to run clover tasks X-Git-Tag: Develop-2_11_2_0-d20201215~97 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=cc58be097b2c6eae1505ec1afa11869602b27861;p=jalview.git JAL-3541 use javaExec to run clover tasks --- diff --git a/build.gradle b/build.gradle index 427d4a3..5597218 100644 --- a/build.gradle +++ b/build.gradle @@ -469,25 +469,35 @@ task cloverInstr() { } +task cloverReportHTML (type: JavaExec) { + inputs.dir "${buildDir}/clover" + outputs.dir "${reportsDir}/clover" + + classpath configurations.cloverRuntime + main = "com.atlassian.clover.reporters.html.HtmlReporter" + args "--initstring", "${buildDir}/clover/clover.db", + "-o", "${reportsDir}/clover" +} + +task cloverReportXML (type: JavaExec) { + inputs.dir "${buildDir}/clover" + outputs.dir "${reportsDir}/clover" + + classpath configurations.cloverRuntime + main = "com.atlassian.clover.reporters.xml.XMLReporter" + args "--initstring", "${buildDir}/clover/clover.db", + "-o", "${reportsDir}/clover/clover.xml" +} task cloverReport { group = "Verification" - description = "Createst the Clover report" + description = "Creates the Clover report" inputs.dir "${buildDir}/clover" outputs.dir "${reportsDir}/clover" onlyIf { file("${buildDir}/clover/clover.db").exists() } - 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) - } + dependsOn cloverReportXML + dependsOn cloverReportHTML } // end clover bits