Skip to content

Instantly share code, notes, and snippets.

@chenzhang2006
Last active May 4, 2020 15:05
Show Gist options
  • Save chenzhang2006/b73690ca4bb6c6550d4520aff06d91c5 to your computer and use it in GitHub Desktop.
Save chenzhang2006/b73690ca4bb6c6550d4520aff06d91c5 to your computer and use it in GitHub Desktop.
publications {
droidlib2(MavenPublication) {
groupId LIB_GROUP_ID
artifactId LIB_ARTIFACT_ID
version LIB_VERSION
artifact("$buildDir/outputs/aar/droidlibrary2-release.aar")
artifact(sourceJar)
pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')
//Iterate over the compile dependencies (we don't want the test ones), adding a <dependency> node for each
configurations.api.allDependencies.each {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment