|
1 | 1 | apply plugin: 'com.android.library'
|
2 |
| -apply plugin: 'com.github.dcendents.android-maven' |
3 |
| -apply plugin: 'com.jfrog.bintray' |
| 2 | +apply plugin: 'maven-publish' |
4 | 3 |
|
5 |
| -// https://github.com/bintray/gradle-bintray-plugin/issues/74#issuecomment-168367341 |
6 |
| -// https://github.com/dcendents/android-maven-gradle-plugin/issues/9 |
7 | 4 | ext {
|
8 | 5 |
|
9 | 6 | 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" |
12 | 9 | POM_PACKAGING = "aar"
|
13 | 10 | POM_DESCRIPTION = "CodePath OAuth Handler"
|
14 | 11 |
|
@@ -54,26 +51,34 @@ android {
|
54 | 51 | }
|
55 | 52 | }
|
56 | 53 |
|
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 | + } |
74 | 67 | }
|
| 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 | + } |
75 | 80 | }
|
76 |
| - |
| 81 | + } |
77 | 82 | }
|
78 | 83 |
|
79 | 84 | task sourcesJar(type: Jar) {
|
|
0 commit comments