UploadArchives creates both debugging and release

I have a download task in my gradle script:

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() } } } 

And running this from teamcity with:

 clean assembleDebug testDebugUnitTest crashlyticsUploadDistributionDebug uploadArchives 

After creating the debug version, uploadArchives also seems to be creating the release version. Therefore, when the assembly is completed, I have both debugging and apk release as the generated artifacts from the assembly. But if I remove uploadArchives, it generates a debug apk.

Is there anyway to prevent this? It doesn’t matter, but it would be nice to just create the version that I specify; i.e. uploadDebugArchives and uploadReleaseArchives would be nice ...

+5
source share
1 answer

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

Set defaultPublishConfig to the type of assembly you want to publish.

+4
source

All Articles