|
1 | 1 | apply plugin: 'com.android.library'
|
2 | 2 | apply plugin: 'maven-publish'
|
3 |
| -apply plugin: 'com.jfrog.bintray' |
4 |
| -apply plugin: 'maven-publish' |
| 3 | +apply plugin: 'signing' |
5 | 4 |
|
6 | 5 | group='com.codepath.libraries'
|
7 | 6 |
|
8 | 7 | ext {
|
9 |
| - ARTIFACT = "asynchttpclient" |
| 8 | + POM_ARTIFACT_ID = "asynchttpclient" |
10 | 9 | POM_NAME = "CodePath Async Http Client"
|
11 |
| - POM_DESC = "Async Http Client wrapper using OkHttp" |
12 |
| - POM_SCM_URL = 'https://github.com/codepath/AsyncHttpClient' |
| 10 | + POM_DESCRIPTION = "Async Http Client wrapper using OkHttp" |
13 | 11 | BASE_VERSION = 2
|
14 |
| - VERSION_NAME = "2.1.1" |
| 12 | + VERSION_NAME = "2.2.0" |
| 13 | + GROUP = 'com.codepath.libraries' |
| 14 | + |
| 15 | + POM_URL = "https://github.com/codepath/android-oauth-handler/" |
| 16 | + POM_SCM_URL = 'https://github.com/codepath/AsyncHttpClient' |
| 17 | + |
| 18 | + POM_LICENCE_NAME = "The Apache Software License, Version 2.0" |
| 19 | + POM_LICENCE_URL = "http://www.apache.org/licenses/LICENSE-2.0.txt" |
| 20 | + |
| 21 | + POM_DEVELOPER_ID = "codepath" |
| 22 | + POM_DEVELOPER_NAME = "CodePath, Inc." |
15 | 23 | }
|
16 | 24 |
|
17 | 25 | version = VERSION_NAME
|
18 |
| -archivesBaseName = ARTIFACT |
19 | 26 |
|
20 | 27 | android {
|
21 | 28 | compileSdkVersion 30
|
@@ -68,30 +75,54 @@ afterEvaluate {
|
68 | 75 | artifact androidSourcesJar
|
69 | 76 |
|
70 | 77 | // You can then customize attributes of the publication as shown below.
|
71 |
| - groupId = group |
72 |
| - artifactId = ARTIFACT |
| 78 | + groupId = GROUP |
| 79 | + artifactId = POM_ARTIFACT_ID |
73 | 80 | version = VERSION_NAME
|
| 81 | + |
| 82 | + pom { |
| 83 | + name = POM_NAME |
| 84 | + url = POM_URL |
| 85 | + description = POM_DESCRIPTION |
| 86 | + licenses { |
| 87 | + license { |
| 88 | + name = POM_LICENCE_NAME |
| 89 | + url = POM_LICENCE_URL |
| 90 | + } |
| 91 | + } |
| 92 | + developers { |
| 93 | + developer { |
| 94 | + id = POM_DEVELOPER_ID |
| 95 | + name = POM_DEVELOPER_NAME |
| 96 | + } |
| 97 | + } |
| 98 | + scm { |
| 99 | + url = POM_SCM_URL |
| 100 | + } |
| 101 | + } |
74 | 102 | }
|
75 | 103 | }
|
76 |
| - } |
77 |
| -} |
78 |
| - |
79 |
| -bintray { |
80 |
| - user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER') |
81 |
| - key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY') |
82 |
| - publications = ['release'] |
83 |
| - |
84 |
| - pkg { |
85 |
| - repo = 'maven' |
86 |
| - name = 'asynchttpclient' |
87 |
| - userOrg = 'codepath' |
88 |
| - licenses = ['Apache-2.0'] |
89 |
| - vcsUrl = POM_SCM_URL |
90 |
| - version { |
91 |
| - name = BASE_VERSION |
92 |
| - desc = POM_NAME |
93 |
| - released = new Date() |
| 104 | + repositories { |
| 105 | + maven { |
| 106 | + name = "Sonatype" |
| 107 | + credentials { |
| 108 | + username = System.getenv('NEXUS_USERNAME') |
| 109 | + password = System.getenv('NEXUS_PASSWORD') |
| 110 | + } |
| 111 | + def releasesRepoUrl = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/' |
| 112 | + def snapshotsRepoUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots/' |
| 113 | + url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl |
| 114 | + setUrl(url) |
| 115 | + } |
94 | 116 | }
|
95 | 117 | }
|
| 118 | +} |
96 | 119 |
|
| 120 | +signing { |
| 121 | + // gpg on MacOS is the same as gpg2 |
| 122 | + // ln -s /usr/local/bin/gpg /usr/local/bin/gpg2 |
| 123 | + // Make sure to populate the variables in gradle.properties |
| 124 | + // signing.gnupg.keyName=XXX |
| 125 | + // signing.gnupg.passpharse |
| 126 | + useGpgCmd() |
| 127 | + sign(publishing.publications) |
97 | 128 | }
|
0 commit comments