buildscript {
dependencies {
- //classpath files("$gradlePluginsDir/gradle-macappbundle-2.3.0-patched-2.3.0.jar")
+ classpath 'org.openclover:clover:4.3.1'
}
}
repositories {
jcenter()
mavenCentral()
+ mavenLocal()
flatDir {
dirs gradlePluginsDir
}
}
mainClassName = launcherClass
+def cloverInstrDir = file("$buildDir/sources-instr")
sourceSets {
runtimeClasspath = compileClasspath
}
+ modules {
+ compileClasspath = fileTree(dir: "$jalviewDir/$j11libDir", include: ["*.jar"])
+
+ runtimeClasspath = compileClasspath
+ }
+
+ clover {
+ java {
+ srcDirs = [ cloverInstrDir ]
+ outputDir = file("$jalviewDir/$testOutputDir")
+ }
+
+ resources {
+ srcDirs = sourceSets.main.resources.srcDirs
+ }
+ compileClasspath = configurations.cloverRuntime + files( sourceSets.clover.java.outputDir )
+ compileClasspath += fileTree(dir: "$jalviewDir/$utilsDir", include: ["**/*.jar"])
+ compileClasspath += fileTree(dir: "$jalviewDir/$libDir", include: ["*.jar"])
+ if (JAVA_VERSION.equals("1.8")) {
+ print("ADDING J11LIBS TO CLASSPATH")
+ compileClasspath += fileTree(dir: "$jalviewDir/$j11libDir", include: ["*.jar"])
+ }
+
+ runtimeClasspath = compileClasspath
+ }
+
test {
java {
- srcDirs "$jalviewDir/$testSourceDir"
+ srcDirs = [ cloverInstrDir ]
outputDir = file("$jalviewDir/$testOutputDir")
}
srcDirs = sourceSets.main.resources.srcDirs
}
- compileClasspath = sourceSets.main.compileClasspath
- compileClasspath += files( sourceSets.test.java.outputDir )
+
+ compileClasspath += configurations.cloverRuntime + files( sourceSets.test.java.outputDir )
compileClasspath += fileTree(dir: "$jalviewDir/$utilsDir", include: ["**/*.jar"])
+ compileClasspath += fileTree(dir: "$jalviewDir/$libDir", include: ["*.jar"])
+ if (JAVA_VERSION.equals("1.8")) {
+ print("ADDING J11LIBS TO CLASSPATH")
+ compileClasspath += fileTree(dir: "$jalviewDir/$j11libDir", include: ["*.jar"])
+ }
runtimeClasspath = compileClasspath
}
+}
- modules {
- compileClasspath = fileTree(dir: "$jalviewDir/$j11libDir", include: ["*.jar"])
+// clover bits
+dependencies {
+ cloverCompile 'org.openclover:clover:4.3.1'
+ testCompile 'org.openclover:clover:4.3.1'
+}
- runtimeClasspath = compileClasspath
- }
+configurations {
+ cloverRuntime
+ cloverRuntime.extendsFrom cloverCompile
+}
+
+task cloverInstr() {
+ inputs.files files (sourceSets.main.allJava, fileTree(dir:"$jalviewDir/$testSourceDir", include: ["**/*.java"]))
+ outputs.dir cloverInstrDir
+ doFirst {
+ delete cloverInstrDir
+ def argsList = ["--initstring", "${buildDir}/clover/clover.db",
+ "-d", "${buildDir}/sources-instr"]
+ 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)
+ }
}
+test.dependsOn cloverInstr
+
+task cloverReport {
+ 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)
+ }
+}
+
+// end clover bits
+
+
compileJava {
doFirst {
}
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
cleanTest {
delete sourceSets.test.java.outputDir
+ delete cloverInstrDir
}
def getDate(format) {
dependsOn copyHelp
}
+
//testReportDirName = "test-reports" // note that test workingDir will be $jalviewDir
test {
dependsOn prepare
- dependsOn compileJava
- dependsOn compileTestJava
- useTestNG {
+
+
+ useTestNG()
+ options {
includeGroups testngGroups
preserveOrder true
}
inputs.dir(project.ext.getdownWebsiteDir)
outputs.dir("$jalviewDir/$install4jBuildDir")
}
+