Skip to content

Commit bdb6791

Browse files
committed
Bump library deps and get rid of Bintray, move to Sonatype
1 parent ea65a2a commit bdb6791

File tree

3 files changed

+32
-40
lines changed

3 files changed

+32
-40
lines changed

build.gradle

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,13 @@
22
buildscript {
33
repositories {
44
google()
5-
jcenter()
5+
mavenCentral()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:3.4.2'
8+
classpath 'com.android.tools.build:gradle:4.0.1'
99
}
1010
}
1111

12-
plugins {
13-
id "com.jfrog.bintray" version "1.8.4"
14-
}
15-
16-
plugins {
17-
id "com.github.dcendents.android-maven" version "2.1"
18-
}
19-
20-
bintray {
21-
publications = []
22-
configurations = []
23-
}
24-
2512
allprojects {
2613
repositories {
2714
google()

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-5.1.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

library/build.gradle

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
apply plugin: 'com.android.library'
2-
apply plugin: 'com.github.dcendents.android-maven'
3-
apply plugin: 'com.jfrog.bintray'
2+
apply plugin: 'maven-publish'
43

5-
// https://github.com/bintray/gradle-bintray-plugin/issues/74#issuecomment-168367341
6-
// https://github.com/dcendents/android-maven-gradle-plugin/issues/9
74
ext {
85

96
GROUP = 'com.codepath.libraries'
10-
BASE_VERSION = "2.1"
11-
VERSION_NAME = "2.1.4"
7+
BASE_VERSION = "2.2"
8+
VERSION_NAME = "2.2.0"
129
POM_PACKAGING = "aar"
1310
POM_DESCRIPTION = "CodePath OAuth Handler"
1411

@@ -54,26 +51,34 @@ android {
5451
}
5552
}
5653

57-
bintray {
58-
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
59-
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
60-
61-
configurations = ['archives'] // needs apply plugin 'com.jfrog.bintray' to work
62-
63-
pkg {
64-
repo = 'maven'
65-
name = 'android-oauth-handler'
66-
userOrg = 'codepath'
67-
licenses = ['Apache-2.0']
68-
vcsUrl = 'https://github.com/codepath/android-oauth-handler.git'
69-
version {
70-
name = BASE_VERSION
71-
desc = POM_NAME
72-
released = new Date()
73-
vcsTag = VERSION_NAME
54+
afterEvaluate {
55+
publishing {
56+
publications {
57+
// Creates a Maven publication called "release".
58+
release(MavenPublication) {
59+
// Applies the component for the release build variant.
60+
from components.release
61+
62+
// You can then customize attributes of the publication as shown below.
63+
groupId = GROUP
64+
artifactId = POM_ARTIFACT_ID
65+
version = VERSION_NAME
66+
}
7467
}
68+
repositories {
69+
maven {
70+
name = "Sonatype"
71+
credentials {
72+
username = System.getenv('NEXUS_USERNAME')
73+
password = System.getenv('NEXUS_PASSWORD')
74+
}
75+
def releasesRepoUrl = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
76+
def snapshotsRepoUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
77+
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
78+
setUrl(url)
79+
}
7580
}
76-
81+
}
7782
}
7883

7984
task sourcesJar(type: Jar) {

0 commit comments

Comments
 (0)