@@ -2,8 +2,8 @@ group = GROUP_ID
22version = VERSION
33
44apply plugin : ' com.android.library'
5+ apply plugin : ' maven-publish'
56apply plugin : ' com.jfrog.bintray'
6- apply plugin : ' com.github.dcendents.android-maven'
77
88android {
99 compileSdkVersion COMPILE_SDK_VERSION
@@ -42,10 +42,11 @@ dependencies {
4242}
4343
4444bintray {
45- configurations = [' archives ' ]
45+ publications = [' MyPublication ' ]
4646 user = bintrayUser
4747 key = bintrayKey
4848 dryRun = dryRun
49+ publish = true
4950
5051 pkg {
5152 repo = REPO
@@ -61,15 +62,31 @@ bintray {
6162 }
6263}
6364
64- install {
65- repositories. mavenInstaller {
66- pom. project {
67- packaging ' aar'
68- name ARTIFACT_ID_LIBRARY
65+ publishing {
66+ publications {
67+ MyPublication (MavenPublication ) {
68+ artifact sourcesJar
69+ artifact javadocJar
70+ artifact " $buildDir /outputs/aar/library-release.aar"
6971 groupId GROUP_ID
7072 artifactId ARTIFACT_ID_LIBRARY
7173 version VERSION
72- url WEBSITE
74+
75+ pom. withXml {
76+ def dependenciesNode = asNode(). appendNode(' dependencies' )
77+ // Iterate over the compile dependencies, adding a <dependency> node for each
78+ configurations. implementation. allDependencies. each {
79+ if (it. group != null && it. name != null && it. version != null ) {
80+ def dependencyNode = dependenciesNode. appendNode(' dependency' )
81+ dependencyNode. appendNode(' groupId' , it. group)
82+ // to change annotation module artifactId explicitly
83+ // ref: https://github.com/dcendents/android-maven-gradle-plugin/issues/9#issuecomment-73550293
84+ def artifactId = (it. group == GROUP_ID && it. name == " annotation" ) ? ARTIFACT_ID_ANNOTATION : it. name
85+ dependencyNode. appendNode(' artifactId' , artifactId)
86+ dependencyNode. appendNode(' version' , it. version)
87+ }
88+ }
89+ }
7390 }
7491 }
7592}
0 commit comments