@@ -5,9 +5,16 @@ apply plugin: 'com.android.library'
55group = ' com.parse'
66version = ' 1.10.6-SNAPSHOT'
77
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+
815buildscript {
916 repositories {
10- mavenCentral ()
17+ jcenter ()
1118 }
1219
1320 dependencies {
@@ -16,14 +23,14 @@ buildscript {
1623}
1724
1825android {
19- compileSdkVersion 23
20- buildToolsVersion " 23 .0.1"
26+ compileSdkVersion 25
27+ buildToolsVersion " 25 .0.1"
2128
2229 useLibrary ' org.apache.http.legacy'
2330
2431 defaultConfig {
2532 minSdkVersion 9
26- targetSdkVersion 23
33+ targetSdkVersion 25
2734 versionCode 1
2835 versionName project. version
2936 }
@@ -94,6 +101,29 @@ def isSnapshot = version.endsWith('-SNAPSHOT')
94101def ossrhUsername = hasProperty(' NEXUS_USERNAME' ) ? NEXUS_USERNAME : System . getenv(' CI_NEXUS_USERNAME' )
95102def ossrhPassword = hasProperty(' NEXUS_PASSWORD' ) ? NEXUS_PASSWORD : System . getenv(' CI_NEXUS_PASSWORD' )
96103
104+ def pomConfig = {
105+ scm {
106+ connection ' scm:git@github.com:ParsePlatform/ParseTwitterUtils-Android.git'
107+ developerConnection ' scm:git@github.com: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+
97127uploadArchives {
98128 repositories. mavenDeployer {
99129 beforeDeployment { MavenDeployment deployment -> signing. signPom(deployment) }
@@ -106,34 +136,15 @@ uploadArchives {
106136 authentication(userName : ossrhUsername, password : ossrhPassword)
107137 }
108138
109- pom . project {
110- name ' ParseTwitterUtils-Android '
111- artifactId = ' parsetwitterutils-android '
139+ def basePom = {
140+ name projName
141+ artifactId projArtifact
112142 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:git@github.com:ParsePlatform/ParseTwitterUtils-Android.git'
118- developerConnection ' scm:git@github.com: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
136145 }
146+
147+ pom. project basePom << pomConfig
137148 }
138149}
139150
@@ -199,3 +210,71 @@ apply plugin: 'com.github.kt3k.coveralls'
199210coveralls. jacocoReportPath = " ${ buildDir} /reports/jacoco/jacocoTestReport/jacocoTestReport.xml"
200211
201212// 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