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