}
mainClassName = launcherClass
-def cloverInstrDir = file("$buildDir/sources-instr")
+def cloverInstrDir = file("$buildDir/$cloverSourcesInstrDir")
+def classes = "$jalviewDir/$classesDir"
+if (clover.equals("true")) {
+ clover = true
+ classes = "$buildDir/$cloverClassesDir"
+} else {
+ clover = false
+ classes = "$jalviewDir/$classesDir"
+}
sourceSets {
main {
java {
srcDirs "$jalviewDir/$sourceDir"
- outputDir = file("$jalviewDir/$classesDir")
+ outputDir = file("$classes")
}
resources {
compileClasspath = files(sourceSets.main.java.outputDir)
compileClasspath += fileTree(dir: "$jalviewDir/$libDir", include: ["*.jar"])
if (JAVA_VERSION.equals("1.8")) {
- print("ADDING J11LIBS TO CLASSPATH")
+ print("ADDING J11LIBS TO CLASSPATH\n")
compileClasspath += fileTree(dir: "$jalviewDir/$j11libDir", include: ["*.jar"])
}
clover {
java {
srcDirs = [ cloverInstrDir ]
- outputDir = file("${buildDir}/clover-classes")
+ outputDir = file("${buildDir}/${cloverClassesDir}")
}
resources {
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")
+ print("ADDING J11LIBS TO CLASSPATH\n")
compileClasspath += fileTree(dir: "$jalviewDir/$j11libDir", include: ["*.jar"])
}
srcDirs = sourceSets.main.resources.srcDirs
}
-
- compileClasspath = configurations.cloverRuntime
- compileClasspath += files( sourceSets.test.java.outputDir )
- compileClasspath += files( sourceSets.clover.java.outputDir )
+ compileClasspath = files( sourceSets.test.java.outputDir )
+ if (clover) {
+ compileClasspath += sourceSets.clover.compileClasspath
+ } else {
+ compileClasspath += sourceSets.main.compileClasspath
+ }
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")) {
- print("ADDING J11LIBS TO CLASSPATH")
+ print("ADDING J11LIBS TO CLASSPATH\n")
compileClasspath += fileTree(dir: "$jalviewDir/$j11libDir", include: ["*.jar"])
}
// clover bits
dependencies {
- cloverCompile 'org.openclover:clover:4.3.1'
- testCompile 'org.openclover:clover:4.3.1'
+ if (clover) {
+ cloverCompile 'org.openclover:clover:4.3.1'
+ testCompile 'org.openclover:clover:4.3.1'
+ }
}
configurations {
doFirst {
delete cloverInstrDir
def argsList = ["--initstring", "${buildDir}/clover/clover.db",
- "-d", "${buildDir}/sources-instr"]
+ "-d", "${buildDir}/${cloverSourcesInstrDir}"]
argsList.addAll(inputs.files.files.collect({ file ->
file.absolutePath
}))
}
}
-test.dependsOn cloverInstr
-
task cloverReport {
inputs.dir "${buildDir}/clover"
}
compileTestJava {
- dependsOn compileCloverJava
+ if (clover) {
+ dependsOn compileCloverJava
+ classpath += configurations.cloverRuntime
+ }
doFirst {
if (JAVA_VERSION.equals("1.8")) {
sourceCompatibility = 1.8
}
print ("Setting target compatibility to "+targetCompatibility+"\n")
}
- classpath += configurations.cloverRuntime
}
task createBuildProperties(type: WriteProperties) {
inputs.dir("$jalviewDir/$sourceDir")
inputs.dir("$jalviewDir/$resourceDir")
- outputFile "$jalviewDir/$classesDir/$buildPropertiesFile"
+ outputFile "$classes/$buildPropertiesFile"
/* taking time/date specific comment out to allow better incremental builds */
//comment "--Jalview Build Details--\n"+getDate("yyyy-MM-dd HH:mm:ss")
comment "--Jalview Build Details--\n"+getDate("yyyy-MM-dd")
property "VERSION", JALVIEW_VERSION
property "INSTALLATION", INSTALLATION+" git-commit:"+getGitHash()+" ["+getGitBranch()+"]"
outputs.file(outputFile)
- outputs.dir("$jalviewDir/$classesDir")
+ outputs.dir("$classes")
}
task syncDocs(type: Sync) {
- def syncDir = "$jalviewDir/$classesDir/$docDir"
+ def syncDir = "$classes/$docDir"
from fileTree("$jalviewDir/$docDir")
into syncDir
}
-def helpFile = "$jalviewDir/$classesDir/$helpDir/help.jhm"
+def helpFile = "$classes/$helpDir/help.jhm"
task syncHelp(type: Sync) {
inputs.files("$jalviewDir/$helpDir")
outputs.files(helpFile)
- def syncDir = "$jalviewDir/$classesDir/$helpDir"
+ def syncDir = "$classes/$helpDir"
from fileTree("$jalviewDir/$helpDir")
into syncDir
}
task copyHelp(type: Copy) {
def inputDir = "$jalviewDir/$helpDir"
- def outputDir = "$jalviewDir/$classesDir/$helpDir"
+ def outputDir = "$classes/$helpDir"
from inputDir
into outputDir
filter(ReplaceTokens, beginToken: '$$', endToken: '$$', tokens: ['Version-Rel': "USING_FILTER"])
}
task syncLib(type: Sync) {
- def syncDir = "$jalviewDir/$classesDir/$libDir"
+ def syncDir = "$classes/$libDir"
from fileTree("$jalviewDir/$libDir")
into syncDir
}
from "$jalviewDir/$resourceDir"
include "**/*.*"
exclude "install4j"
- into "$jalviewDir/$classesDir"
+ into "$classes"
preserve {
include "**"
}
//testReportDirName = "test-reports" // note that test workingDir will be $jalviewDir
test {
dependsOn prepare
-
+ if (clover) {
+ dependsOn cloverInstr
+ }
+ print("Running tests " + (clover?"WITH":"WITHOUT") + " clover [clover="+clover+"]\n")
useTestNG() {
includeGroups testngGroups
dependsOn copyHelp
classpath = sourceSets.main.compileClasspath
main = "com.sun.java.help.search.Indexer"
- workingDir = "$jalviewDir/$classesDir/$helpDir"
+ workingDir = "$classes/$helpDir"
def argDir = "html"
args = [ argDir ]
inputs.dir("$workingDir/$argDir")
- outputs.dir("$jalviewDir/$classesDir/doc")
- outputs.dir("$jalviewDir/$classesDir/help")
+ outputs.dir("$classes/doc")
+ outputs.dir("$classes/help")
outputs.file("$workingDir/JavaHelpSearch/DOCS")
outputs.file("$workingDir/JavaHelpSearch/DOCS.TAB")
outputs.file("$workingDir/JavaHelpSearch/OFFSETS")
dependsOn prepare, compileLinkCheck
classpath = files("$jalviewDir/$utilsDir")
main = "HelpLinksChecker"
- workingDir = "$jalviewDir"
- args = [ "$classesDir/$helpDir", "-nointernet" ]
+ workingDir = jalviewDir
+ def help = "$classes/$helpDir"
+ args = [ "$classes/$helpDir", "-nointernet" ]
+ //args = [ "$classesDir/$helpDir", "-nointernet" ]
doFirst {
standardOutput new FileOutputStream("$jalviewDir/$utilsDir/HelpLinksChecker.out")
exclude "**/*.jar"
exclude "**/*.jar.*"
- inputs.dir("$jalviewDir/$classesDir")
+ inputs.dir("$classes")
outputs.file("$jalviewDir/$packageDir/$archiveName")
}
task copyJars(type: Copy) {
- from fileTree("$jalviewDir/$classesDir").include("**/*.jar").include("*.jar").files
+ from fileTree("$classes").include("**/*.jar").include("*.jar").files
into "$jalviewDir/$packageDir"
}