forked from IntelLabs/GKL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
210 lines (180 loc) · 6.63 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
plugins {
id 'java'
id 'maven'
id 'signing'
id 'com.palantir.git-version' version '0.5.2'
}
compileJava {
options.compilerArgs = ['-proc:none', '-Xlint:all','-Werror','-Xdiags:verbose']
}
compileTestJava {
options.compilerArgs = ['-proc:none', '-Xlint:all','-Werror','-Xdiags:verbose']
}
repositories {
mavenLocal()
mavenCentral()
maven { url "https://artifactory.broadinstitute.org/artifactory/libs-snapshot/" }
}
dependencies {
compile 'commons-io:commons-io:2.4'
compile 'org.broadinstitute:gatk-native-bindings:0.1.0-rc-1'
compile 'org.apache.logging.log4j:log4j-api:2.5'
compile 'org.apache.logging.log4j:log4j-core:2.5'
compile 'com.github.samtools:htsjdk:2.9.0'
testCompile 'org.testng:testng:6.9.9'
}
task wrapper(type: Wrapper) {
gradleVersion = '3.2.1'
}
//===================================================================
// build
//===================================================================
final nativeBuildDir = "$buildDir/native"
task cmakeConfig(type: Exec) {
// hide stdout, but print stderr
standardOutput = new ByteArrayOutputStream()
doFirst {mkdir nativeBuildDir}
workingDir nativeBuildDir
commandLine 'cmake', '-Wno-dev', projectDir
inputs.files fileTree(projectDir) {include '**/CMakeLists.txt'}
outputs.files "$nativeBuildDir/Makefile"
}
task cmakeBuild(type: Exec) {
// hide stdout, but print stderr
standardOutput = new ByteArrayOutputStream()
workingDir nativeBuildDir
commandLine 'make', 'install'
// always run this task
outputs.upToDateWhen {false}
}
task copyNativeLib(type: Copy) {
from nativeBuildDir
into "$buildDir/classes/main/com/intel/gkl/native"
include '*.so'
include '*.dylib'
}
task buildOnMac(type: Exec) {
String mac_host = project.ext.properties.mac_host ? project.ext.properties.mac_host : "gkl-mac"
workingDir '.'
commandLine 'scripts/buildOnMac.sh', mac_host
onlyIf {project.hasProperty('mac') || project.hasProperty('mac_host') || gradle.taskGraph.hasTask(uploadArchives)}
}
compileJava.finalizedBy copyNativeLib
copyNativeLib.finalizedBy buildOnMac
copyNativeLib.dependsOn cmakeBuild
cmakeBuild.dependsOn cmakeConfig
//===================================================================
// test
//===================================================================
test {
useTestNG()
// propagate system properties to test JVM
systemProperties = System.getProperties()
if (project.hasProperty('debug')) {
jvmArgs '-verbose:jni', '-Xcheck:jni', '-XX:+RestoreMXCSROnJNICalls'
}
else {
jvmArgs '-Xcheck:jni', '-XX:+RestoreMXCSROnJNICalls'
}
testLogging {
if (!System.env.CI.toString().toBoolean()) {
events "passed", "skipped", "failed", "standardOut", "standardError"
}
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)"
}
}
}
// always rerun tests
outputs.upToDateWhen { false }
}
//===================================================================
// release
//===================================================================
final isRelease = project.hasProperty("release")
version = (isRelease ? gitVersion() : gitVersion() + "-SNAPSHOT").replaceAll(".dirty", "")
group = "com.intel.gkl"
jar {
baseName = "gkl"
// include LICENSE file in jar
from "LICENSE"
exclude "log4j2.xml"
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from 'build/docs/javadoc'
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
artifacts {
archives jar
archives javadocJar
archives sourcesJar
}
signing {
required { isRelease && gradle.taskGraph.hasTask(uploadArchives) }
sign configurations.archives
}
install.doFirst { println "Version: $version" }
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
// repository(url: uri('testMaven'))
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: project.findProperty("sonatypeUsername"), password: project.findProperty("sonatypePassword"))
proxy(host: "proxy-us.intel.com", port: 912, type: 'https')
}
// snapshotRepository(url: uri('testMavenSnapshot'))
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: project.findProperty("sonatypeUsername"), password: project.findProperty("sonatypePassword"))
proxy(host: "proxy-us.intel.com", port: 912, type: 'https')
}
pom.project {
name 'Intel Genomics Kernel Library (GKL)'
packaging 'jar'
description 'Genomics compute kernels optimized for Intel Architecture'
url 'https://github.com/Intel-HLS/GKL'
scm {
connection 'scm:[email protected]:Intel-HLS/GKL.git'
developerConnection 'scm:[email protected]:Intel-HLS/GKL.git'
url 'scm:[email protected]:Intel-HLS/GKL.git'
}
licenses {
license {
name 'MIT License'
url 'https://opensource.org/licenses/MIT'
distribution 'repo'
}
license {
name 'BSD 3-Clause'
url 'https://opensource.org/licenses/BSD-3-Clause'
distribution 'repo'
}
license {
name 'Zlib License'
url 'https://opensource.org/licenses/Zlib'
distribution 'repo'
}
}
developers {
developer {
name = "George Powley"
email = "[email protected]"
}
developer {
name = "Priya Vaidya"
email = "[email protected]"
}
developer {
name = "Ernesto Brau"
email = "[email protected]"
}
}
}
}
}
}