clover {
java {
srcDirs = [ cloverInstrDir ]
- outputDir = file("$jalviewDir/$testOutputDir")
+ outputDir = file("${buildDir}/clover-classes")
}
resources {
test {
java {
- srcDirs = [ cloverInstrDir ]
+ srcDirs "$jalviewDir/$testSourceDir"
outputDir = file("$jalviewDir/$testOutputDir")
}
}
- compileClasspath += configurations.cloverRuntime + files( sourceSets.test.java.outputDir )
+ compileClasspath = configurations.cloverRuntime
+ compileClasspath += files( sourceSets.test.java.outputDir )
+ compileClasspath += files( sourceSets.clover.java.outputDir )
+ compileClasspath += files( sourceSets.main.resources.srcDirs)
compileClasspath += fileTree(dir: "$jalviewDir/$utilsDir", include: ["**/*.jar"])
compileClasspath += fileTree(dir: "$jalviewDir/$libDir", include: ["*.jar"])
if (JAVA_VERSION.equals("1.8")) {
}
task cloverInstr() {
- inputs.files files (sourceSets.main.allJava, fileTree(dir:"$jalviewDir/$testSourceDir", include: ["**/*.java"]))
+ // only instrument source, we build test classes as normal
+ inputs.files files (sourceSets.main.allJava) // , fileTree(dir:"$jalviewDir/$testSourceDir", include: ["**/*.java"]))
outputs.dir cloverInstrDir
doFirst {
}
test.dependsOn cloverInstr
+
task cloverReport {
inputs.dir "${buildDir}/clover"
}
compileTestJava {
-
+ dependsOn compileCloverJava
doFirst {
if (JAVA_VERSION.equals("1.8")) {
sourceCompatibility = 1.8
}
-//compileCloverJava {
-//
-// doFirst {
-// if (JAVA_VERSION.equals("1.8")) {
-// sourceCompatibility = 1.8
-// targetCompatibility = 1.8
-// } else if (JAVA_VERSION.equals("11")) {
-// sourceCompatibility = 11
-// targetCompatibility = 11
-//
-// options.compilerArgs += [
-// '--module-path', sourceSets.modules.compileClasspath.asPath,
-// '--add-modules', j11modules
-// ]
-// }
-// print ("Setting target compatibility to "+targetCompatibility+"\n")
-// }
-// classpath += configurations.cloverRuntime
-//}
+compileCloverJava {
+
+ doFirst {
+ if (JAVA_VERSION.equals("1.8")) {
+ sourceCompatibility = 1.8
+ targetCompatibility = 1.8
+ } else if (JAVA_VERSION.equals("11")) {
+ sourceCompatibility = 11
+ targetCompatibility = 11
+
+ options.compilerArgs += [
+ '--module-path', sourceSets.modules.compileClasspath.asPath,
+ '--add-modules', j11modules
+ ]
+ }
+ print ("Setting target compatibility to "+targetCompatibility+"\n")
+ }
+ classpath += configurations.cloverRuntime
+}
clean {
delete sourceSets.main.java.outputDir