From cc58be097b2c6eae1505ec1afa11869602b27861 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Tue, 25 Feb 2020 17:10:19 +0000 Subject: [PATCH] JAL-3541 use javaExec to run clover tasks --- build.gradle | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) 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 -- 1.7.10.2