Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

uploadArchives build both debug and release

I have an upload 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 building the debug version it seems like uploadArchives is building a release version too. So when the build is done I have both a debug and release apk as generated artefacts from the build. But if I remove uploadArchives it only generates debug apk.

Is there anyway to prevent this? It's not a big deal but it would be nice to only build the version I'm specifying; i.e. uploadDebugArchives and uploadReleaseArchives would be nice...

like image 477
peuhse Avatar asked Jun 16 '16 08:06

peuhse


1 Answers

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

Set defaultPublishConfig to the buildtype you want to publish.

like image 75
RaGe Avatar answered Oct 03 '22 00:10

RaGe