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 '
3
+ apply plugin : ' signing '
4
4
5
- // https://github.com/bintray/gradle-bintray-plugin/issues/74#issuecomment-168367341
6
- // https://github.com/dcendents/android-maven-gradle-plugin/issues/9
7
5
ext {
8
6
9
7
GROUP = ' com.codepath.libraries'
10
- BASE_VERSION = " 2.1 "
11
- VERSION_NAME = " 2.1.4 "
8
+ BASE_VERSION = " 2.3 "
9
+ VERSION_NAME = " 2.3.0 "
12
10
POM_PACKAGING = " aar"
13
11
POM_DESCRIPTION = " CodePath OAuth Handler"
14
12
@@ -54,26 +52,65 @@ android {
54
52
}
55
53
}
56
54
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
55
+ afterEvaluate {
56
+ publishing {
57
+ publications {
58
+ // Creates a Maven publication called "release".
59
+ release(MavenPublication ) {
60
+ // Applies the component for the release build variant.
61
+ from components. release
62
+
63
+ // You can then customize attributes of the publication as shown below.
64
+ groupId = GROUP
65
+ artifactId = POM_ARTIFACT_ID
66
+ version = VERSION_NAME
67
+
68
+ pom {
69
+ name = POM_NAME
70
+ url = POM_URL
71
+ description = POM_DESCRIPTION
72
+ licenses {
73
+ license {
74
+ name = POM_LICENCE_NAME
75
+ url = POM_LICENCE_URL
76
+ }
77
+ }
78
+ developers {
79
+ developer {
80
+ id = POM_DEVELOPER_ID
81
+ name = POM_DEVELOPER_NAME
82
+ }
83
+ }
84
+ scm {
85
+ url = POM_SCM_URL
86
+ }
87
+ }
88
+ }
89
+ }
90
+ repositories {
91
+ maven {
92
+ name = " Sonatype"
93
+ credentials {
94
+ username = System . getenv(' NEXUS_USERNAME' )
95
+ password = System . getenv(' NEXUS_PASSWORD' )
96
+ }
97
+ def releasesRepoUrl = ' https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
98
+ def snapshotsRepoUrl = ' https://s01.oss.sonatype.org/content/repositories/snapshots/'
99
+ url = version. endsWith(' SNAPSHOT' ) ? snapshotsRepoUrl : releasesRepoUrl
100
+ setUrl(url)
101
+ }
74
102
}
75
103
}
104
+ }
76
105
106
+ signing {
107
+ // gpg on MacOS is the same as gpg2
108
+ // ln -s /usr/local/bin/gpg /usr/local/bin/gpg2
109
+ // Make sure to populate the variables in gradle.properties
110
+ // signing.gnupg.keyName=XXX
111
+ // signing.gnupg.passpharse
112
+ useGpgCmd()
113
+ sign(publishing. publications)
77
114
}
78
115
79
116
task sourcesJar (type : Jar ) {
@@ -86,7 +123,7 @@ artifacts {
86
123
}
87
124
88
125
ext {
89
- supportVersion = ' 28.0.0'
126
+ supportVersion = ' 28.0.0'
90
127
}
91
128
92
129
dependencies {
0 commit comments