Created
          April 3, 2018 07:19 
        
      - 
      
 - 
        
Save swarawan/adcb137928cecd66820e71677a6ea28e to your computer and use it in GitHub Desktop.  
  
    
      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
    
  
  
    
  | apply plugin: 'maven-publish' | |
| publishing { | |
| publications { | |
| aar(MavenPublication) { | |
| setGroupId 'com.swarawan' | |
| artifactId project.getName() | |
| version libraryVersion | |
| artifact("$buildDir/outputs/aar/${project.getName()}-release.aar") | |
| pom.withXml { | |
| def dependencies = asNode().appendNode('dependencies') | |
| configurations.getByName("releaseCompileClasspath").getResolvedConfiguration().getFirstLevelModuleDependencies().each { | |
| if (it.moduleGroup == 'com.android.databinding' || it.moduleVersion == 'unspecified') { | |
| println("ignoring dependency ${it.moduleGroup}:${it.moduleName}:${it.moduleVersion}") | |
| return; | |
| } | |
| def dependency = dependencies.appendNode('dependency') | |
| dependency.appendNode('groupId', it.moduleGroup) | |
| println(it.moduleGroup) | |
| println(it.moduleVersion) | |
| println(it.moduleName) | |
| dependency.appendNode('artifactId', it.moduleName) | |
| dependency.appendNode('version', it.moduleVersion) | |
| } | |
| } | |
| } | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment