-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle
59 lines (48 loc) · 1.3 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
allprojects {
group 'com.zendesk.jazon'
}
subprojects {
apply plugin: 'groovy'
sourceCompatibility = 1.8
repositories {
jcenter()
}
task sourceJar(type: Jar, dependsOn: classes) {
classifier 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
artifacts {
archives sourceJar, javadocJar
}
apply plugin: 'signing'
apply plugin: 'maven-publish'
signing {
required { !isSnapshotVersion() }
sign publishing.publications
}
publishing {
repositories {
maven {
String snapshotUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
String releaseUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
url = isSnapshotVersion() ? snapshotUrl : releaseUrl
credentials {
username project.findProperty('ossrhUsername') ?: ''
password project.findProperty('ossrhPassword') ?: ''
}
}
}
}
publish {
doLast {
println "The published version: ${version}"
}
}
}
boolean isSnapshotVersion() {
version.endsWith('SNAPSHOT')
}