gradle uploadArchives task to upload single flavor

i have an app with multiple product flavors. im using the maven plugin and the uploadArchives task to upload my apk to nexus, using this:

my problem is running uploadArchives runs the build and assemble tasks for all flavors and uploads them to my nexus repo.

i want to be able to assemble and upload a single flavor and not necessarily all of them .

i dont understand exactly what uploadArchives does, why does it assemble the app ? shouldnt it only upload whatever was generated by an explicit assemble task? how do i run it per flavor?



My solution to this problem was to create another module that references the specific flavor and use uploadArchives on that module.

To add a dependency to a specific flavor use this line in your Gradle dependency section:

compile project(path: ':lib', configuration: 'flavor')

The upload to the repository should upload all artifacts from the build, which in this case includes all flavours. This way you can guarantee that all artifacts in the repository are from the same codebase.

What is your use case to upload only some?

You should be able to just build the productFlavor your interested in. For example

gradle clean assembleMyProductFlavor uploadArchives Then the upload should only see the flavor your interested as the other apk files don't exist.

Need Your Help

Latent variable from a set of multicollinear variables

r correlation factor-analysis r-lavaan

I have an environmental data set consisting of continuous, non-normally distributed observations. My goal is to construct a latent variable from the measured 5 variables. The theory behind this con...

Android webview crashes randomly due to SSE call

android jquery-mobile android-webview server-sent-events

I have a Jquery Mobile 1.4 with Jquery 2.0 webpage which I serve in an Android Webview (Android 4+). All worked fine until I started to use SSE. The App periodically crashes due to a Signal 11 on the