@@ -5,9 +5,16 @@ apply plugin: 'com.android.library'
5
5
group = ' com.parse'
6
6
version = ' 1.10.6-SNAPSHOT'
7
7
8
+ ext {
9
+ projName = ' ParseTwitterUtils-Android'
10
+ projArtifact = ' parsetwitterutils-android'
11
+ projDescription = ' A utility library to authenticate ParseUsers with Twitter'
12
+ projGitLink = ' https://github.com/ParsePlatform/ParseTwitterUtils-Android'
13
+ }
14
+
8
15
buildscript {
9
16
repositories {
10
- mavenCentral ()
17
+ jcenter ()
11
18
}
12
19
13
20
dependencies {
@@ -16,14 +23,14 @@ buildscript {
16
23
}
17
24
18
25
android {
19
- compileSdkVersion 23
20
- buildToolsVersion " 23 .0.1"
26
+ compileSdkVersion 25
27
+ buildToolsVersion " 25 .0.1"
21
28
22
29
useLibrary ' org.apache.http.legacy'
23
30
24
31
defaultConfig {
25
32
minSdkVersion 9
26
- targetSdkVersion 23
33
+ targetSdkVersion 25
27
34
versionCode 1
28
35
versionName project. version
29
36
}
@@ -94,6 +101,29 @@ def isSnapshot = version.endsWith('-SNAPSHOT')
94
101
def ossrhUsername = hasProperty(' NEXUS_USERNAME' ) ? NEXUS_USERNAME : System . getenv(' CI_NEXUS_USERNAME' )
95
102
def ossrhPassword = hasProperty(' NEXUS_PASSWORD' ) ? NEXUS_PASSWORD : System . getenv(' CI_NEXUS_PASSWORD' )
96
103
104
+ def pomConfig = {
105
+ scm {
106
+ connection
' scm:[email protected] :ParsePlatform/ParseTwitterUtils-Android.git'
107
+ developerConnection
' scm:[email protected] :ParsePlatform/ParseTwitterUtils-Android.git'
108
+ url projGitLink
109
+ }
110
+
111
+ licenses {
112
+ license {
113
+ name ' BSD License'
114
+ url ' https://github.com/ParsePlatform/ParseTwitterUtils-Android/blob/master/LICENSE'
115
+ distribution ' repo'
116
+ }
117
+ }
118
+
119
+ developers {
120
+ developer {
121
+ id ' parse'
122
+ name ' Parse'
123
+ }
124
+ }
125
+ }
126
+
97
127
uploadArchives {
98
128
repositories. mavenDeployer {
99
129
beforeDeployment { MavenDeployment deployment -> signing. signPom(deployment) }
@@ -106,34 +136,15 @@ uploadArchives {
106
136
authentication(userName : ossrhUsername, password : ossrhPassword)
107
137
}
108
138
109
- pom . project {
110
- name ' ParseTwitterUtils-Android '
111
- artifactId = ' parsetwitterutils-android '
139
+ def basePom = {
140
+ name projName
141
+ artifactId projArtifact
112
142
packaging ' aar'
113
- description ' A utility library to authenticate ParseUsers with Twitter'
114
- url ' https://github.com/ParsePlatform/ParseTwitterUtils-Android'
115
-
116
- scm {
117
- connection
' scm:[email protected] :ParsePlatform/ParseTwitterUtils-Android.git'
118
- developerConnection
' scm:[email protected] :ParsePlatform/ParseTwitterUtils-Android.git'
119
- url ' https://github.com/ParsePlatform/ParseTwitterUtils-Android'
120
- }
121
-
122
- licenses {
123
- license {
124
- name ' BSD License'
125
- url ' https://github.com/ParsePlatform/ParseTwitterUtils-Android/blob/master/LICENSE'
126
- distribution ' repo'
127
- }
128
- }
129
-
130
- developers {
131
- developer {
132
- id ' parse'
133
- name ' Parse'
134
- }
135
- }
143
+ description projDescription
144
+ url projGitLink
136
145
}
146
+
147
+ pom. project basePom << pomConfig
137
148
}
138
149
}
139
150
@@ -199,3 +210,71 @@ apply plugin: 'com.github.kt3k.coveralls'
199
210
coveralls. jacocoReportPath = " ${ buildDir} /reports/jacoco/jacocoTestReport/jacocoTestReport.xml"
200
211
201
212
// endregion
213
+
214
+ apply plugin : ' com.jfrog.bintray'
215
+
216
+ bintray {
217
+ user = System . getenv(' BINTRAY_USER' )
218
+ key = System . getenv(' BINTRAY_API_KEY' )
219
+
220
+ publications = [" MyPublication" ]
221
+
222
+ dryRun = true
223
+ publish = true
224
+ pkg {
225
+ repo = ' maven'
226
+ name = ' ParseTwitterUtils-Android'
227
+ userOrg = ' parse'
228
+ licenses = [' BSD License' ]
229
+ vcsUrl = projGitLink
230
+ version {
231
+ name = project. version
232
+ desc = projDescription
233
+ released = new Date ()
234
+ vcsTag = project. version
235
+
236
+ // Sonatype username/passwrod must be set for this operation to happen
237
+ mavenCentralSync {
238
+ sync = true
239
+ user = ossrhUsername
240
+ password = ossrhPassword
241
+ close = ' 1' // release automatically
242
+ }
243
+ }
244
+ }
245
+ }
246
+
247
+ // Create the publication with the pom configuration:
248
+ apply plugin : ' maven-publish'
249
+
250
+ publishing {
251
+ publications {
252
+ MyPublication (MavenPublication ) {
253
+ groupId group
254
+ artifactId projArtifact
255
+ artifacts = [androidSourcesJar, bundleRelease]
256
+ version version
257
+ pom. withXml {
258
+ def root = asNode()
259
+ root. appendNode(' description' , projDescription)
260
+ root. appendNode(' name' , projName)
261
+ root. appendNode(' url' , projGitLink)
262
+ root. children(). last() + pomConfig
263
+
264
+ // maven-publish workaround to include dependencies
265
+ def dependenciesNode = asNode(). appendNode(' dependencies' )
266
+
267
+ // Iterate over the compile dependencies (we don't want the test ones), adding a <dependency> node for each
268
+ configurations. compile. allDependencies. each {
269
+ def dependencyNode = dependenciesNode. appendNode(' dependency' )
270
+ dependencyNode. appendNode(' groupId' , it. group)
271
+ dependencyNode. appendNode(' artifactId' , it. name)
272
+ dependencyNode. appendNode(' version' , it. version)
273
+ }
274
+
275
+ }
276
+ }
277
+ }
278
+ }
279
+
280
+ // End of Bintray plugin
0 commit comments