Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- apply plugin: 'maven-publish'
- android {
- defaultConfig {
- project.archivesBaseName = <insert project name>
- project.version = android.defaultConfig.versionName
- }
- }
- publishing {
- publications {
- bar(MavenPublication) {
- groupId '<insert group id>'
- artifactId archivesBaseName
- version version
- artifact(sourceJar)
- artifact("$buildDir/outputs/aar/${archivesBaseName}-${version}.aar")
- 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.compile.allDependencies.each {
- if (it.group != null && (it.name != null || "unspecified" == (it.name)) && it.version != null) {
- def dependencyNode = dependenciesNode.appendNode('dependency')
- dependencyNode.appendNode('groupId', it.group)
- dependencyNode.appendNode('artifactId', it.name)
- dependencyNode.appendNode('version', it.version)
- }
- }
- }
- }
- }
- repositories {
- maven {
- def userHome = System.getProperty("user.home")
- url "${userHome}/.m2/repository"
- }
- }
- }
Add Comment
Please, Sign In to add comment