-
-
Save Sar777/c6dc903935a71a2c0abe39c7763808fc to your computer and use it in GitHub Desktop.
Gradle task for generating Maven's POM file for Android AAR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task createPom { | |
apply plugin: 'maven' | |
description "Generates pom.xml" | |
pom { | |
project { | |
groupId 'com.example' | |
artifactId 'example' | |
version '0.0.1-SNAPSHOT' | |
packaging 'aar' | |
} | |
}.withXml { | |
def dependenciesNode = asNode().appendNode('dependencies') | |
configurations.compile.allDependencies.each { dependency -> | |
def dependencyNode = dependenciesNode.appendNode('dependency') | |
dependencyNode.appendNode('groupId', dependency.group) | |
dependencyNode.appendNode('artifactId', dependency.name) | |
dependencyNode.appendNode('version', dependency.version) | |
} | |
}.writeTo("$buildDir/pom.xml") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment