@@ -6,6 +6,13 @@ apply plugin: 'com.github.kt3k.coveralls'
6
6
group = ' com.parse'
7
7
version = ' 1.0.3-SNAPSHOT'
8
8
9
+ ext {
10
+ projDescription = ' A library that gives you access to the powerful Parse cloud platform from your Android app.'
11
+ artifact = ' parse-livequery-android'
12
+ projName = ' Parse-LiveQuery-Android'
13
+ gitLink = ' https://github.com/ParsePlatform/ParseLiveQuery-Android'
14
+ }
15
+
9
16
buildscript {
10
17
repositories {
11
18
jcenter()
@@ -107,6 +114,29 @@ def isSnapshot = version.endsWith('-SNAPSHOT')
107
114
def ossrhUsername = hasProperty(' NEXUS_USERNAME' ) ? NEXUS_USERNAME : System . getenv(' CI_NEXUS_USERNAME' )
108
115
def ossrhPassword = hasProperty(' NEXUS_PASSWORD' ) ? NEXUS_PASSWORD : System . getenv(' CI_NEXUS_PASSWORD' )
109
116
117
+ def pomConfig = {
118
+ scm {
119
+ connection
' scm:[email protected] :ParsePlatform/ParseLiveQuery-Android.git'
120
+ developerConnection
' scm:[email protected] :ParsePlatform/ParseLiveQuery-Android.git'
121
+ url gitLink
122
+ }
123
+
124
+ licenses {
125
+ license {
126
+ name ' BSD License'
127
+ url ' https://github.com/ParsePlatform/ParseLiveQuery-Android/blob/master/LICENSE'
128
+ distribution ' repo'
129
+ }
130
+ }
131
+
132
+ developers {
133
+ developer {
134
+ id ' parse'
135
+ name ' Parse'
136
+ }
137
+ }
138
+ }
139
+
110
140
uploadArchives {
111
141
repositories. mavenDeployer {
112
142
beforeDeployment { MavenDeployment deployment -> signing. signPom(deployment) }
@@ -119,34 +149,15 @@ uploadArchives {
119
149
authentication(userName : ossrhUsername, password : ossrhPassword)
120
150
}
121
151
122
- pom. project {
123
- name ' Parse-LiveQuery-Android'
124
- artifactId = ' parse-livequery-android'
125
- packaging ' aar'
126
- description ' A library that gives you access to the powerful Parse cloud platform from your Android app.'
127
- url ' https://github.com/ParsePlatform/ParseLiveQuery-Android'
128
-
129
- scm {
130
- connection
' scm:[email protected] :ParsePlatform/ParseLiveQuery-Android.git'
131
- developerConnection
' scm:[email protected] :ParsePlatform/ParseLiveQuery-Android.git'
132
- url ' https://github.com/ParsePlatform/ParseLiveQuery-Android'
133
- }
134
-
135
- licenses {
136
- license {
137
- name ' BSD License'
138
- url ' https://github.com/ParsePlatform/ParseLiveQuery-Android/blob/master/LICENSE'
139
- distribution ' repo'
140
- }
141
- }
142
-
143
- developers {
144
- developer {
145
- id ' parse'
146
- name ' Parse'
147
- }
148
- }
152
+ def basePom = {
153
+ name projName
154
+ artifactId artifact
155
+ packaging ' aar'
156
+ description projDescription
157
+ url gitLink
149
158
}
159
+
160
+ pom. project basePom << pomConfig
150
161
}
151
162
}
152
163
@@ -207,3 +218,73 @@ task jacocoTestReport(type: JacocoReport, dependsOn: "testDebugUnitTest") {
207
218
coveralls. jacocoReportPath = " ${ buildDir} /reports/jacoco/jacocoTestReport/jacocoTestReport.xml"
208
219
209
220
// endregion
221
+
222
+ // Requires apply plugin: 'com.jfrog.bintray'
223
+
224
+ apply plugin : ' com.jfrog.bintray'
225
+
226
+ bintray {
227
+ user = System . getenv(' BINTRAY_USER' )
228
+ key = System . getenv(' BINTRAY_API_KEY' )
229
+
230
+ publications = [" MyPublication" ]
231
+
232
+ dryRun = true
233
+ publish = true
234
+ pkg {
235
+ repo = ' maven'
236
+ name = ' parse-livequery-android'
237
+ userOrg = ' parse'
238
+ licenses = [' BSD License' ]
239
+ vcsUrl = ' https://github.com/parse-community/Parse-SDK-Android'
240
+ version {
241
+ name = project. version
242
+ desc = projDescription
243
+ released = new Date ()
244
+ vcsTag = project. version
245
+
246
+ // Sonatype username/passwrod must be set for this operation to happen
247
+ mavenCentralSync {
248
+ sync = true
249
+ user = ossrhUsername
250
+ password = ossrhPassword
251
+ close = ' 1' // release automatically
252
+ }
253
+ }
254
+ }
255
+ }
256
+
257
+ // Create the publication with the pom configuration:
258
+ apply plugin : ' maven-publish'
259
+
260
+ publishing {
261
+ publications {
262
+ MyPublication (MavenPublication ) {
263
+ groupId group
264
+ artifactId artifact
265
+ artifacts = [androidSourcesJar, bundleRelease]
266
+ version version
267
+ pom. withXml {
268
+ def root = asNode()
269
+ root. appendNode(' description' , projDescription)
270
+ root. appendNode(' name' , projName)
271
+ root. appendNode(' url' , gitLink)
272
+ root. children(). last() + pomConfig
273
+
274
+ // maven-publish workaround to include dependencies
275
+ def dependenciesNode = asNode(). appendNode(' dependencies' )
276
+
277
+ // Iterate over the compile dependencies (we don't want the test ones), adding a <dependency> node for each
278
+ configurations. compile. allDependencies. each {
279
+ def dependencyNode = dependenciesNode. appendNode(' dependency' )
280
+ dependencyNode. appendNode(' groupId' , it. group)
281
+ dependencyNode. appendNode(' artifactId' , it. name)
282
+ dependencyNode. appendNode(' version' , it. version)
283
+ }
284
+
285
+ }
286
+ }
287
+ }
288
+ }
289
+
290
+ // End of Bintray plugin
0 commit comments