-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
128 lines (111 loc) · 3.22 KB
/
build.gradle
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
buildscript {
repositories {
mavenCentral()
}
}
plugins {
id 'java'
id "com.vanniktech.maven.publish" version "0.31.0-rc1"
id 'signing'
id 'com.palantir.git-version' version '3.1.0' //version helper
}
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.testng:testng:6.9.6'
}
final pkg_version = "1.1.0"
final isRelease = Boolean.getBoolean("release")
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/$libname*"
delete fileTree("$cpath") {include "$libname*", "*.o"}
}
build.dependsOn buildBwaLib
test.dependsOn buildBwaLib
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) {
from 'build/docs/javadoc'
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
}
/**
*This specifies what artifacts will be built and uploaded when performing a maven upload.
*/
artifacts {
archives jar
archives javadocJar
archives sourcesJar
}
def assertLibExists(lib){
if ( ! file(lib).exists()){
throw new GradleException("Could not perform a maven release because $lib is missing. You must include both OSX and Linux binaries to release. " +
"You can run scripts/build_both_dylib_and_so.sh to build both if you are on a Broad Institute connected mac.")
}
}
import com.vanniktech.maven.publish.SonatypeHost
mavenPublishing {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
coordinates("org.umccr.java", "gatk-bwamem-jni", pkg_version)
signAllPublications()
pom {
name = "gatk-bwamem-jni"
description = "java bindings for the bwa-mem assembler"
inceptionYear = "2025"
url = "https://github.com/umccr/gatk-bwamem-jni/"
licenses {
license {
name = "BSD 3-Clause"
url = "https://github.com/umccr/gatk-bwamem-jni/blob/master/LICENSE.TXT"
distribution = "repo"
}
}
developers {
developer {
id = "umccr"
name = "UMCCR"
url = "https://github.com/umccr/"
}
}
scm {
url = "https://github.com/umccr/gatk-bwamem-jni/"
connection = "scm:git:git://github.com/umccr/gatk-bwamem-jni.git"
developerConnection = "scm:git:ssh://[email protected]/umccr/gatk-bwamem-jni.git"
}
}
}