发布Android库时删除 - 释放后缀

时间:2015-07-07 01:23:38

标签: android maven

根据http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Library-Publication,当publishNonDefault=true时,Maven发布插件会将其他变体发布为带分类器的额外包。

我有一个包含2种构建类型的库项目 - Debug和Release。 maven插件将我的工件发布为
enter image description here

我正在使用以下脚本将我的库发布到Bintray

group = PROJ_GROUP
version = PROJ_VERSION
project.archivesBaseName = PROJ_ARTIFACTID

apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven-publish'

task sourcesJar(type: Jar) {
    from android.sourceSets.main.java.srcDirs
    classifier = 'sources'
}

task javadoc(type: Javadoc) {
    source = android.sourceSets.main.java.srcDirs
    classpath += configurations.compile
    classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
    // TODO #43: Figure out how to build with AAR dependencies
    // Gradle: error: package android.support.v4.util does not exist
    // Gradle: error: cannot find symbol class SimpleArrayMap
    failOnError false
}

task javadocJar(type: Jar, dependsOn: javadoc) {
    classifier = 'javadoc'
    from javadoc.destinationDir
}

javadoc {
    options{
        encoding "UTF-8"
        charSet 'UTF-8'
        author true
        version true
        links "http://docs.oracle.com/javase/7/docs/api"
        title PROJ_ARTIFACTID
    }
}

artifacts {
    archives javadocJar
    archives sourcesJar
}

def pomConfig = {
    licenses {
        license {
            name "The Apache Software License, Version 2.0"
            url "http://www.apache.org/licenses/LICENSE-2.0.txt"
            distribution "repo"
        }
    }
    developers {
        developer {
            id DEVELOPER_ID
            name DEVELOPER_NAME
            email DEVELOPER_EMAIL
        }
    }
}

publishing {
    publications {
        mavenJava(MavenPublication) {
            artifactId PROJ_ARTIFACTID

            pom{
                packaging 'aar'
            }
            pom.withXml {
                def root = asNode()
                root.appendNode('description', PROJ_DESCRIPTION)
                root.children().last() + pomConfig
            }
        }
    }
}

bintray {
    Properties properties = new Properties()
    properties.load(project.rootProject.file('bintray.properties').newDataInputStream())

    user = properties.getProperty("BINTRAY_USER")
    key = properties.getProperty("BINTRAY_KEY")

    configurations = ['archives']
    publications = ['mavenJava']
    publish = false

    pkg {
        repo = 'maven'
        name = PROJ_NAME
        desc = PROJ_DESCRIPTION
        websiteUrl = PROJ_WEBSITEURL
        issueTrackerUrl = PROJ_ISSUETRACKERURL
        vcsUrl = PROJ_VCSURL
        licenses = ['Apache-2.0']
        publicDownloadNumbers = false
    }
}

如何让插件删除-release后缀?

0 个答案:

没有答案