Skip to content
This repository was archived by the owner on Feb 14, 2020. It is now read-only.

Commit 3e3a58e

Browse files
committed
Upgrade to Gradle 3.5
Bump to target SDK 25 Add Bintray
1 parent c72356e commit 3e3a58e

File tree

3 files changed

+117
-34
lines changed

3 files changed

+117
-34
lines changed

build.gradle

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
buildscript {
33
repositories {
4-
mavenCentral()
4+
jcenter()
55
}
66
dependencies {
7-
classpath 'com.android.tools.build:gradle:1.3.1'
7+
classpath 'com.android.tools.build:gradle:2.3.1'
88
}
99
}
1010

11+
plugins {
12+
id "com.jfrog.bintray" version "1.7.3"
13+
}
14+
1115
allprojects {
1216
repositories {
13-
mavenCentral()
17+
jcenter()
1418
}
1519
}

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip

library/build.gradle

Lines changed: 109 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,16 @@ apply plugin: 'com.android.library'
55
group = 'com.parse'
66
version = '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+
815
buildscript {
916
repositories {
10-
mavenCentral()
17+
jcenter()
1118
}
1219

1320
dependencies {
@@ -16,14 +23,14 @@ buildscript {
1623
}
1724

1825
android {
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')
94101
def ossrhUsername = hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : System.getenv('CI_NEXUS_USERNAME')
95102
def ossrhPassword = hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : System.getenv('CI_NEXUS_PASSWORD')
96103

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+
97127
uploadArchives {
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:[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
136145
}
146+
147+
pom.project basePom << pomConfig
137148
}
138149
}
139150

@@ -199,3 +210,71 @@ apply plugin: 'com.github.kt3k.coveralls'
199210
coveralls.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

Comments
 (0)