Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I create a .apk in Jenkins with a specific flavour?

I've an android project that has 2 flavours defined. How can I make a build via Jenkins with a specific flavour? This are my flavours in the build.graddle:

 productFlavors{
flavour 1 {
    applicationId "app_id"
    resValue "string", "app_name", "Flavour 1 app name"
    .......
}

flavour 2 {
    applicationId "app_id2"
    resValue "string", "app_name", "Flavour 2 app name"
    .......

}

}

this is how I build it in jenkins: enter image description here

Thank you in advance!

like image 765
android enthusiast Avatar asked Dec 11 '15 12:12

android enthusiast


1 Answers

Your task currently tells gradle to do a clean build of all release flavors:

clean build assembleRelease

You can change this to build only one flavor, using the code below. See the Gradle User Guide for more info.

clean build assembleFlavor1Release
like image 149
fractalwrench Avatar answered Oct 15 '22 19:10

fractalwrench