android – uploadArchives构建调试和发布

我的gradle脚本中有一个上传任务:

uploadArchives {
    repositories {
        mavenDeployer {
            repository(url: "${nexusUrl}/content/repositories/apps-releases")     {
                    authentication(userName: nexusUsername, password: nexusPassword)
            }
                snapshotRepository(url: "${nexusUrl}/content/repositories/apps-snapshots") {
                    authentication(userName: nexusUsername, password: nexusPassword)
            }
            pom.groupId = "$defaultApplicationId"
            pom.artifactId = 'MyApp'
            pom.version = applicationVersionName()
        }
    }
}

从teamcity运行这个:

clean assembleDebug testDebugUnitTest crashlyticsUploadDistributionDebug uploadArchives

在构建调试版本之后,似乎uploadArchives也正在构建一个发行版本.因此,当构建完成时,我将调试和发布apk作为生成的构造中的人工制品.但如果我删除uploadArchives它只生成调试apk.

反正有没有阻止这个?这不是什么大问题,但只建立我指定的版本会很好;即uploadDebugArchives和uploadReleaseArchives会很好……

最佳答案:

见:http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Library-Publication

将defaultPublishConfig设置为要发布的构建类型.

相关文章

安装环境都很简单,就是下载工具需要在华为开发者联盟里注册...
上传的方式有两种,第一种是通过bintray官方出的插件bintray...
转载自: 完美解决Error:SSLpeershutdownincorrectly打开gr...
https://www.jianshu.com/p/9220227cdfb3buildscript{ext.ko...
Markdown版本笔记我的GitHub首页我的博客我的微信我的邮箱My...
 跟着教程做的,已经有了JDK,直接进行后面的步骤,下载安装...