-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathpublish_jbwa.gradle
116 lines (96 loc) · 3.15 KB
/
publish_jbwa.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
// Gradle script to upload a custom jbwa jar to sonatype
//
// before running this script the native jni libraries must be constructed and placed in the jnilib directory
// this requires building on both osx and a linux system in order to to generate the .jnilib and .so
//
// Usage:
// gradle -b publish_jbwa.gradle uploadArchives -Dversion=version -DsonatypeUser=user -DsonatypePassword=password -DisRelease=true
//
//
plugins {
id 'maven'
id 'signing'
id 'java'
}
final isRelease = Boolean.getBoolean("isRelease")
version = isRelease ? System.getProperty("version") : System.getProperty("version") + "-SNAPSHOT"
group = "com.github.lindenb"
final sonatypeUser = System.getProperty("sonatypeUser")
final sonatypePassword = System.getProperty("sonatypePassword")
sourceSets {
main {
java {
srcDir 'src/main/java'
exclude '**/ws/**'
}
}
}
//add jnilibs to jar
processResources {
doFirst {
assert file("jnilib/libbwajni.jnilib").exists()
assert file("jnilib/libbwajni.so").exists()
}
from 'jnilib'
}
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 sourcesJar
archives javadocJar
}
/*
* Sign non-snapshot releases with our secret key. This should never need to be invoked directly.
*/
signing {
required { isRelease && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
uploadArchives {
doFirst {
println "Attempting to upload $jar"
}
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: sonatypeUser, password: sonatypePassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots") {
authentication(userName: sonatypeUser, password: sonatypePassword)
}
pom.project {
name 'jbwa'
packaging 'jar'
description 'Java Bindings (JNI) for bwa'
url 'https://github.com/lindenb/jbwa'
scm {
url 'scm:[email protected]:lindenb/jbwa.git'
connection 'scm:[email protected]:lindenb/jbwa.git'
developerConnection 'scm:[email protected]:lindenb/jbwa.git'
}
developers {
developer {
id = "jbwadev"
name = "Pierre Lindenbaum"
email = "[email protected]"
}
}
licenses {
license {
name 'Apache License Version 2.0'
url 'https://github.com/lindenb/jbwa/blob/master/LICENSE.txt'
distribution 'repo'
}
}
}
}
}
}