forked from aws/amazon-chime-sdk-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
publishing.gradle
244 lines (229 loc) · 9.43 KB
/
publishing.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'maven-publish'
def localPropertiesFile = new File(getRootDir(), "local.properties")
Properties localProperties = new Properties()
if (localPropertiesFile.exists()) {
localPropertiesFile.withInputStream { instr ->
localProperties.load(instr)
}
}
def versionFile = new File(getRootDir(), "version.properties")
Properties versionProperties = new Properties()
if (versionFile.exists()) {
versionFile.withInputStream { instr ->
versionProperties.load(instr)
}
}
version = versionProperties.getProperty('VERSION')
def media_version = versionProperties.getProperty('MEDIA_VERSION')
def machineLearningVersion = versionProperties.getProperty('MACHINE_LEARNING_VERSION')
signing {
if (!project.hasProperty('signing.key') || !project.hasProperty('signing.password') || !project.hasProperty('signing.keyId')) {
logger.error('Missing GPG Signing Properties.')
}
def signingKey = findProperty("signing.key")
def signingPassword = findProperty("signing.password")
def keyId = findProperty("signing.keyId")
useInMemoryPgpKeys(keyId, signingKey, signingPassword)
sign(publishing.publications)
}
project.afterEvaluate {
publishing {
publications {
publishChimeSDK(MavenPublication) {
afterEvaluate {
from components.release
}
groupId = GROUP
version = version
artifactId = ARTIFACT_ID_SDK
pom {
name = POM_SDK_NAME
description = POM_DESCRIPTION_SDK
url = POM_URL
licenses {
license {
name = POM_LICENCE_NAME
url = POM_LICENCE_URL
distribution = POM_LICENCE_DIST
}
}
scm {
url = POM_SCM_URL
connection = POM_SCM_CONNECTION
developerConnection = POM_SCM_DEV_CONNECTION
}
developers {
developer {
id = POM_DEVELOPER_ID
organization = POM_DEVELOPER_ORGANIZATION
organizationUrl = POM_DEVELOPER_ORGANIZATION_URL
}
}
}
}
publishChimeSDKMedia(MavenPublication) {
groupId = GROUP
version = media_version
artifactId = ARTIFACT_ID_SDK_MEDIA
artifact("$buildDir/../libs/amazon-chime-sdk-media.aar")
pom {
name = POM_SDK_MEDIA_NAME
description = POM_DESCRIPTION_SDK_MEDIA
url = POM_URL
licenses {
license {
name = POM_LICENCE_NAME
url = POM_LICENCE_URL
distribution = POM_LICENCE_DIST
}
}
scm {
url = POM_SCM_URL
connection = POM_SCM_CONNECTION
developerConnection = POM_SCM_DEV_CONNECTION
}
developers {
developer {
id = POM_DEVELOPER_ID
organization = POM_DEVELOPER_ORGANIZATION
organizationUrl = POM_DEVELOPER_ORGANIZATION_URL
}
}
}
}
publishChimeSDKMediaX86Stub(MavenPublication) {
groupId = GROUP
version = media_version
artifactId = ARTIFACT_ID_SDK_MEDIA_X86_STUB
artifact("$buildDir/../libs/amazon-chime-sdk-media-x86-stub.aar")
pom {
name = POM_SDK_MEDIA_X86_STUB_NAME
description = POM_DESCRIPTION_SDK_MEDIA_X86_STUB
url = POM_URL
licenses {
license {
name = POM_LICENCE_NAME
url = POM_LICENCE_URL
distribution = POM_LICENCE_DIST
}
}
scm {
url = POM_SCM_URL
connection = POM_SCM_CONNECTION
developerConnection = POM_SCM_DEV_CONNECTION
}
developers {
developer {
id = POM_DEVELOPER_ID
organization = POM_DEVELOPER_ORGANIZATION
organizationUrl = POM_DEVELOPER_ORGANIZATION_URL
}
}
}
}
publishChimeSDKMediaNoVideoCodecs(MavenPublication) {
groupId = GROUP
version = media_version
artifactId = ARTIFACT_ID_SDK_MEDIA_NO_VIDEO_CODECS
artifact("$buildDir/../libs/amazon-chime-sdk-media-no-video-codecs.aar")
pom {
name = POM_SDK_MEDIA_NO_VIDEO_CODECS_NAME
description = POM_DESCRIPTION_SDK_MEDIA_NO_VIDEO_CODECS
url = POM_URL
licenses {
license {
name = POM_LICENCE_NAME
url = POM_LICENCE_URL
distribution = POM_LICENCE_DIST
}
}
scm {
url = POM_SCM_URL
connection = POM_SCM_CONNECTION
developerConnection = POM_SCM_DEV_CONNECTION
}
developers {
developer {
id = POM_DEVELOPER_ID
organization = POM_DEVELOPER_ORGANIZATION
organizationUrl = POM_DEVELOPER_ORGANIZATION_URL
}
}
}
}
publishChimeSDKMediaNoVideoCodecsX86Stub(MavenPublication) {
groupId = GROUP
version = media_version
artifactId = ARTIFACT_ID_SDK_MEDIA_NO_VIDEO_CODECS_X86_STUB
artifact("$buildDir/../libs/amazon-chime-sdk-media-no-video-codecs-x86-stub.aar")
pom {
name = POM_SDK_MEDIA_NO_VIDEO_CODECS_X86_STUB_NAME
description = POM_DESCRIPTION_SDK_MEDIA_NO_VIDEO_CODECS_X86_STUB
url = POM_URL
licenses {
license {
name = POM_LICENCE_NAME
url = POM_LICENCE_URL
distribution = POM_LICENCE_DIST
}
}
scm {
url = POM_SCM_URL
connection = POM_SCM_CONNECTION
developerConnection = POM_SCM_DEV_CONNECTION
}
developers {
developer {
id = POM_DEVELOPER_ID
organization = POM_DEVELOPER_ORGANIZATION
organizationUrl = POM_DEVELOPER_ORGANIZATION_URL
}
}
}
}
publishChimeSDKMachineLearning(MavenPublication) {
groupId = GROUP
version = machineLearningVersion
artifactId = ARTIFACT_ID_SDK_MACHINE_LEARNING
artifact("$buildDir/../libs/amazon-chime-sdk-machine-learning.aar")
pom {
name = POM_SDK_MACHINE_LEARNING_NAME
description = POM_DESCRIPTION_SDK_MACHINE_LEARNING
url = POM_URL
licenses {
license {
name = POM_LICENCE_NAME
url = POM_LICENCE_URL
distribution = POM_LICENCE_DIST
}
}
scm {
url = POM_SCM_URL
connection = POM_SCM_CONNECTION
developerConnection = POM_SCM_DEV_CONNECTION
}
developers {
developer {
id = POM_DEVELOPER_ID
organization = POM_DEVELOPER_ORGANIZATION
organizationUrl = POM_DEVELOPER_ORGANIZATION_URL
}
}
}
}
}
repositories {
maven {
def releasesRepoUrl = "https://aws.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://aws.oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = localProperties.getProperty('SONATYPE_USERNAME')
password = localProperties.getProperty('SONATYPE_PASSWORD')
}
}
}
}
}