1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
plugins {
id 'java'
id 'maven'
}
repositories {
mavenCentral()
}
dependencies {
testCompile 'org.testng:testng:6.9.6'
}
group = "org.broadinstitute"
String cpath = "src/main/c"
String libname = "libbwa"
task buildBwaLib(type: Exec){
workingDir "$cpath"
outputs.files "$cpath/libbwa*"
outputs.dir "$cpath/bwa"
commandLine "make"
String home = System.properties."java.home"
//strip the trailing jre
String corrected = home.endsWith("jre") ? home.substring(0, home.length() - 4) : home
environment JAVA_HOME : corrected
doFirst { println "using $home -> $corrected as JAVA_HOME" }
}
clean {
delete "$cpath/bwa"
delete "$cpath/$libname*"
delete fileTree("$cpath") {include "$libname*", "*.o"}
}
processResources {
dependsOn buildBwaLib
// from cpath
// include "$libname*"
}
test {
useTestNG()
testLogging {
testLogging {
events "skipped", "failed"
exceptionFormat = "full"
}
afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
println "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)"
}
}
}
}
javadoc {
options.addStringOption('Xdoclint:none', '-quiet')
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from 'build/docs/javadoc'
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
|