forked from APISENSE/rhino-android
-
Notifications
You must be signed in to change notification settings - Fork 8
/
nexusConfig.gradle
44 lines (36 loc) · 1.19 KB
/
nexusConfig.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
// Default parameters
if (!project.hasProperty("nexusUrl")) {
ext.nexusUrl = "file:///tmp/sdkRepo"
}
if (!project.hasProperty("nexusUsername")) {
ext.nexusUsername = ""
}
if (!project.hasProperty("nexusPassword")) {
ext.nexusPassword = ""
}
ext.nexusRelease = "${nexusUrl}/service/local/staging/deploy/maven2/"
ext.nexusSnapshot = "${nexusUrl}/content/repositories/snapshots/"
private boolean signingConfigured() {
return project.hasProperty("signing.keyId") && project.hasProperty("signing.password") \
&& project.hasProperty("signing.secretKeyRingFile")
}
allprojects {
apply plugin: 'maven'
if (signingConfigured()) {
apply plugin: 'signing'
signing {
sign configurations.archives
}
}
uploadArchives.repositories.mavenDeployer {
if (signingConfigured()) {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
}
repository(url: nexusRelease) {
authentication(userName: nexusUsername, password: nexusPassword)
}
snapshotRepository(url: nexusSnapshot) {
authentication(userName: nexusUsername, password: nexusPassword)
}
}
}