import groovy.util.XmlParser
import groovy.xml.XmlUtil
+
buildscript {
+ repositories {
+ mavenCentral()
+ mavenLocal()
+ }
dependencies {
classpath 'org.openclover:clover:4.4.1'
}
}
+
plugins {
id 'java'
id 'application'
jcenter()
mavenCentral()
mavenLocal()
- flatDir {
- dirs gradlePluginsDir
- }
-}
-
-dependencies {
}
// clover
cloverInstrDir = file("${buildDir}/${cloverSourcesInstrDir}")
+ cloverDb = string("${buildDir}/clover/clover.db")
classesDir = string("${jalviewDir}/${classes_dir}")
if (clover.equals("true")) {
use_clover = true
// clover bits
dependencies {
+ cloverCompile 'org.openclover:clover:4.4.1'
if (use_clover) {
- cloverCompile 'org.openclover:clover:4.4.1'
testCompile 'org.openclover:clover:4.4.1'
}
}
-
configurations {
cloverRuntime
cloverRuntime.extendsFrom cloverCompile
}
+
+// eclipse project and settings files creation, also used by buildship
eclipse {
project {
name = eclipse_project_name
}
-task cloverInstr() {
+task cloverInstr {
// only instrument source, we build test classes as normal
inputs.files files (sourceSets.main.allJava,sourceSets.test.allJava) // , fileTree(dir:"$jalviewDir/$testSourceDir", include: ["**/*.java"]))
outputs.dir cloverInstrDir
doFirst {
- delete cloverInstrDir
- def argsList = ["--initstring", "${buildDir}/clover/clover.db",
- "-d", "${buildDir}/${cloverSourcesInstrDir}"]
- argsList.addAll(inputs.files.files.collect({ file ->
- file.absolutePath
- }))
+ //delete cloverInstrDir
+ def argsList = [
+ "--initstring",
+ cloverDb,
+ "-d",
+ cloverInstrDir.getPath(),
+ ]
+ argsList.addAll(
+ inputs.files.files.collect(
+ { file -> file.absolutePath }
+ )
+ )
String[] args = argsList.toArray()
println("About to instrument "+args.length +" files")
com.atlassian.clover.CloverInstr.mainImpl(args)
}
+cloverClasses.dependsOn cloverInstr
+
+
task cloverReport {
group = "Verification"
- description = "Creates the Clover report"
- inputs.dir "${buildDir}/clover"
- outputs.dir "${reportsDir}/clover"
- onlyIf {
- file("${buildDir}/clover/clover.db").exists()
- }
+ description = "Creates the Clover report"
+ inputs.dir "${buildDir}/clover"
+ outputs.dir "${reportsDir}/clover"
+ onlyIf {
+ file(cloverDb).exists()
+ }
doFirst {
- def argsList = ["--initstring", "${buildDir}/clover/clover.db",
- "-o", "${reportsDir}/clover"]
+ def argsList = [
+ "--initstring",
+ cloverDb,
+ "-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()
+ args = [
+ "--initstring",
+ cloverDb,
+ "-o",
+ "${reportsDir}/clover/clover.xml"
+ ].toArray()
com.atlassian.clover.reporters.xml.XMLReporter.runReport(args)
}
}
doFirst {
delete sourceSets.test.java.outputDir
delete cloverInstrDir
+ delete cloverDb
}
}