-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathsonatype.gradle
103 lines (90 loc) · 2.62 KB
/
sonatype.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
apply plugin: 'maven'
apply plugin: 'signing'
def SONATYPE_RELEASE_URL = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def SONATYPE_SNAPSHOT_URL = "https://oss.sonatype.org/content/repositories/snapshots/"
def shouldPublish
def isReleaseBuild
if (hasProperty("release")) {
shouldPublish = true
isReleaseBuild = true
} else if (hasProperty("ci")) {
shouldPublish = true
version += "-SNAPSHOT"
}
if (shouldPublish) {
signing {
sign configurations.archives
}
} else {
task signArchives {
// do nothing
}
}
afterEvaluate {
uploadArchives {
onlyIf { ourJar.didWork || javadocJar.didWork || sourcesJar.didWork }
repositories {
if (!shouldPublish) {
mavenLocal()
} else {
mavenDeployer {
if (shouldPublish) {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
}
repository(url: (isReleaseBuild ? SONATYPE_RELEASE_URL : SONATYPE_SNAPSHOT_URL)) {
authentication(userName: nexusUsername, password: nexusPassword)
}
pom.project {
name project.name
packaging 'jar'
description project.description
url 'http://sneer.me'
scm {
url 'https://github.com/sneerteam/sneer'
connection '[email protected]:sneerteam/sneer.git'
}
licenses {
license {
name 'The GNU Lesser General Public License, version 3.0 (LGPL-3.0)'
url 'http://opensource.org/licenses/lgpl-3.0.html'
distribution 'repo'
}
}
developers {
developer {
id 'klauswuestefeld'
name 'Klaus Wuestefeld'
email '[email protected]'
}
developer {
id 'fabioroger'
name 'Fabio Roger Manera'
email '[email protected]'
}
developer {
id 'bamboo'
name 'Rodrigo B. de Oliveira'
email '[email protected]'
}
developer {
id 'felipebueno'
name 'Felipe Bueno'
email '[email protected]'
}
developer {
id 'dhmendes'
name 'Diego Mendes'
email '[email protected]'
}
developer {
id 'oakes'
name 'Zach Oakes'
email '[email protected]'
}
}
}
}
}
}
}
}