forked from signalapp/zkgroup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.gradle
75 lines (62 loc) · 2.08 KB
/
deploy.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
apply plugin: 'maven'
apply plugin: 'signing'
version = '0.7.1'
group = 'org.signal'
def isReleaseBuild() {
return version.contains("SNAPSHOT") == false
}
def getReleaseRepositoryUrl() {
return hasProperty('sonatypeRepo') ? sonatypeRepo
: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
}
def getRepositoryUsername() {
return hasProperty('whisperSonatypeUsername') ? whisperSonatypeUsername : ""
}
def getRepositoryPassword() {
return hasProperty('whisperSonatypePassword') ? whisperSonatypePassword : ""
}
signing {
required { isReleaseBuild() && gradle.taskGraph.hasTask('uploadArchives') }
sign configurations.archives
}
uploadArchives {
configuration = configurations.archives
repositories.mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: getReleaseRepositoryUrl()) {
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
}
pom.project {
name archivesBaseName
description 'Zero Knowledge Groups library'
url 'https://github.com/signalapp/zkgroup'
scm {
url 'scm:[email protected]:signalapp/zkgroup.git'
connection 'scm:[email protected]:signalapp/zkgroup.git'
developerConnection 'scm:[email protected]:signalapp/zkgroup.git'
}
licenses {
license {
name 'GPLv3'
url 'https://www.gnu.org/licenses/gpl-3.0.txt'
distribution 'repo'
}
}
developers {
developer {
name 'Trevor Perrin'
}
}
}
}
}
task installArchives(type: Upload) {
group 'Deploy'
description 'Installs the artifacts to the local Maven repository.'
configuration = configurations['archives']
repositories {
mavenDeployer {
repository url: "file://${System.properties['user.home']}/.m2/repository"
}
}
}