from_installv1.gradle 1.66 KB
apply plugin: 'com.github.dcendents.android-maven'

group = publishedGroupId                               // Maven Group ID for the artifact

install {
    repositories.mavenInstaller {
        // This generates POM.xml with proper parameters
        pom {
            project {
                packaging 'aar'
                groupId publishedGroupId
                artifactId artifact

                // Add your description here
                name libraryName
                description libraryDescription
                url siteUrl

                // Set your license
                licenses {
                    license {
                        name licenseName
                        url licenseUrl
                    }
                }
                developers {
                    developer {
                        id developerId
                        name developerName
                        email developerEmail
                    }
                }
                scm {
                    connection gitUrl
                    developerConnection gitUrl
                    url siteUrl
                }

                pom.whenConfigured {
                    pom ->
                        List list = new ArrayList()
                        pom.dependencies.findAll {
                            dep ->
                                dep.groupId == rootProject.name || dep.groupId == 'com.android.support'
                        }.collect {
                            dep ->
                                list.add(dep)
                        }
                        pom.dependencies.removeAll(list)
                }
            }
        }
    }
}