sourceDir = string("${jalviewDir}/${bareSourceDir}")
resourceDir = string("${jalviewDir}/${resource_dir}")
bareTestSourceDir = string(test_source_dir)
- testSourceDir = string("${jalviewDir}/${bareTestSourceDir}")
+ testDir = string("${jalviewDir}/${bareTestSourceDir}")
classesDir = string("${jalviewDir}/${classes_dir}")
// clover
useClover = clover.equals("true")
- cloverInstrDir = file("${buildDir}/clover/${clover_sources_instr_dir}")
- cloverClassesDir = file("${buildDir}/clover/${clover_classes_dir}")
- cloverReportDir = file("${buildDir}/clover/${clover_report_dir}")
- cloverDb = string("${buildDir}/clover/clover.db")
+ cloverBuildDir = "${buildDir}/clover"
+ cloverInstrDir = file("${cloverBuildDir}/clover-instr")
+ cloverClassesDir = file("${cloverBuildDir}/clover-classes")
+ cloverReportDir = file("${cloverBuildDir}/clover-report")
+ cloverTestInstrDir = file("${cloverBuildDir}/clover-test-instr")
+ cloverTestClassesDir = file("${cloverBuildDir}/clover-test-classes")
+ //cloverTestClassesDir = cloverClassesDir
+ cloverDb = string("${cloverBuildDir}/clover.db")
resourceClassesDir = useClover ? cloverClassesDir : classesDir
+ testSourceDir = useClover ? cloverTestInstrDir : testDir
+ testClassesDir = useClover ? cloverTestClassesDir : "${jalviewDir}/${test_output_dir}"
+
getdownWebsiteDir = string("${jalviewDir}/${getdown_website_dir}/${JAVA_VERSION}")
buildDist = true
}
compileClasspath = files( sourceSets.clover.java.outputDir )
+ //compileClasspath += files( testClassesDir )
compileClasspath += fileTree(dir: "${jalviewDir}/${libDir}", include: ["*.jar"])
compileClasspath += fileTree(dir: "${jalviewDir}/${clover_lib_dir}", include: ["*.jar"])
+ compileClasspath += fileTree(dir: "${jalviewDir}/${utils_dir}/testnglibs", include: ["**/*.jar"])
runtimeClasspath = compileClasspath
}
test {
java {
srcDirs testSourceDir
- outputDir = file("${jalviewDir}/${test_output_dir}")
+ outputDir = file(testClassesDir)
}
resources {
runtimeClasspath = compileClasspath
}
+
}
// clover bits
-task cloverInstr(type: JavaExec) {
+task cleanClover {
+ doFirst {
+ delete cloverBuildDir
+ }
+}
+
+
+task cloverInstrJava(type: JavaExec) {
group = "Verification"
- description = "Create clover instrumented source files"
+ description = "Create clover instrumented source java files"
+
+ dependsOn cleanClover
inputs.files(sourceSets.main.allJava)
outputs.dir(cloverInstrDir)
doFirst {
delete cloverInstrDir
- delete cloverDb
println("Clover: About to instrument "+srcFiles.size() +" files")
}
}
+task cloverInstrTests(type: JavaExec) {
+ group = "Verification"
+ description = "Create clover instrumented source test files"
+
+ dependsOn cleanClover
+
+ inputs.files(testDir)
+ outputs.dir(cloverTestInstrDir)
+
+ classpath = sourceSets.clover.compileClasspath
+ main = "com.atlassian.clover.CloverInstr"
+
+ def argsList = [
+ "--encoding",
+ "UTF-8",
+ "--initstring",
+ cloverDb,
+ "--srcdir",
+ testDir,
+ "--destdir",
+ cloverTestInstrDir.getPath(),
+ ]
+ args argsList.toArray()
+
+ doFirst {
+ delete cloverTestInstrDir
+ println("Clover: About to instrument test files")
+ }
+}
+
+
+task cloverInstr {
+ group = "Verification"
+ description = "Create clover instrumented all source files"
+
+ dependsOn cloverInstrJava
+ dependsOn cloverInstrTests
+}
+
+
cloverClasses.dependsOn cloverInstr
-task cloverXmlReport(type: JavaExec) {
+task cloverConsoleReport(type: JavaExec) {
group = "Verification"
- description = "Creates clover XML report"
+ description = "Creates clover console report"
- inputs.dir cloverClassesDir
- outputs.dir cloverReportDir
onlyIf {
file(cloverDb).exists()
}
+ inputs.dir cloverClassesDir
+
classpath = sourceSets.clover.runtimeClasspath
- main = "com.atlassian.clover.reporters.xml.XMLReporter"
+ main = "com.atlassian.clover.reporters.console.ConsoleReporter"
def argsList = [
"--alwaysreport",
"--initstring",
cloverDb,
- "--outfile",
- "${cloverReportDir}/clover.xml"
+ "--unittests"
]
args argsList.toArray()
group = "Verification"
description = "Creates clover HTML report"
- inputs.dir cloverClassesDir
- outputs.dir cloverReportDir
onlyIf {
file(cloverDb).exists()
}
+ def cloverHtmlDir = "${cloverReportDir}/clover"
+ inputs.dir cloverClassesDir
+ outputs.dir cloverHtmlDir
+
classpath = sourceSets.clover.runtimeClasspath
main = "com.atlassian.clover.reporters.html.HtmlReporter"
"--initstring",
cloverDb,
"--outputdir",
- "${cloverReportDir}/clover"
+ cloverHtmlDir
+ ]
+
+ args argsList.toArray()
+}
+
+
+task cloverXmlReport(type: JavaExec) {
+ group = "Verification"
+ description = "Creates clover XML report"
+
+ onlyIf {
+ file(cloverDb).exists()
+ }
+
+ def cloverXmlFile = "${cloverReportDir}/clover.xml"
+ inputs.dir cloverClassesDir
+ outputs.file cloverXmlFile
+
+ classpath = sourceSets.clover.runtimeClasspath
+ main = "com.atlassian.clover.reporters.xml.XMLReporter"
+
+ def argsList = [
+ "--alwaysreport",
+ "--initstring",
+ cloverDb,
+ "--outfile",
+ cloverXmlFile
]
args argsList.toArray()
options.compilerArgs += additional_compiler_args
print ("Setting target compatibility to "+targetCompatibility+"\n")
}
- classpath += configurations.cloverRuntime
-}
-
-
-task cleanClover {
- doFirst {
- delete "${buildDir/clover}"
- }
+ //classpath += configurations.cloverRuntime
}
// end clover bits
//testReportDirName = "test-reports" // note that test workingDir will be $jalviewDir
test {
dependsOn prepare
+ //dependsOn compileJava ////? DELETE
if (useClover) {
dependsOn cloverClasses
- } else {
- dependsOn compileJava
+ } else { //?
+ dependsOn compileJava //?
}
useTestNG() {