Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to add flavour parameter for build.gradle with multiple app config? #1

Open
cyrillekrasinski opened this issue Feb 8, 2018 · 6 comments

Comments

@cyrillekrasinski
Copy link

Hi, could you add in your plugin a parameter in order to manager flavours?
Indeed, in case of our app, we have the same code to build two different apps and so have two flavours defined and for each a versionName and a versionCode value.

Moreover, I've tested your plugin and I don't understand how the bump_type parameter works since I must set a value for the version_name parameter. I thought that the bump_type will increment automatically the versionName value. Which values are expected for bump_type parameter?

Thanks a lot.

@igorlamos
Copy link
Contributor

Hey @cyrillekrasinski ... I can take a look at it - but - are you able to give me your build.gradle file? I don't do much for Android, so just to have a specific idea of what's going on exactly.

This plugin implementation is not complete, so maybe you have ran into some issues with bump_type - I've to take a look at it before I'll be able to respond to your question.

Thanks!

@cyrillekrasinski
Copy link
Author

Hi @igorlamos,

Thanks for your feedback. Indeed, the bump_type argument doesn't work too.
Concerning my build.gradle file, please see below an extract of this file (I've modified the file to remove all sensitive data with '...' or other name) which shows the flavours configuration:

apply plugin: 'com.android.application'
description = ...
version = '1.0-SNAPSHOT'
android
{
compileSdkVersion 25
buildToolsVersion '26.0.2'
lintOptions {
abortOnError false
checkReleaseBuilds false
}

        useLibrary 'org.apache.http.legacy'

        defaultConfig
                {
                    minSdkVersion 21
                    targetSdkVersion 21
                    multiDexEnabled true
                    vectorDrawables.useSupportLibrary = true
                }

        signingConfigs
                {
                    debug
                            {
                                storeFile file(DEBUG_STORE_FILE)
                                storePassword DEBUG_STORE_PASSWORD
                                keyAlias DEBUG_KEY_ALIAS
                                keyPassword DEBUG_KEY_PASSWORD
                            }
                    release
                            {
                                storeFile file(RELEASE_STORE_FILE)
                                storePassword RELEASE_STORE_PASSWORD
                                keyAlias RELEASE_KEY_ALIAS
                                keyPassword RELEASE_KEY_PASSWORD
                            }
                }

        buildTypes
                {
                    debug {
                        proguardFiles 'proguard-rules.txt'
                        signingConfig signingConfigs.debug
                    }

                    release {
                        proguardFiles 'proguard-rules.txt'
                        signingConfig signingConfigs.release
                    }
                }

        packagingOptions {
            ...
        }

        flavorDimensions "business"

        productFlavors
                {
                    flavor1
                            {
                                dimension "business"
                                applicationId 'id1'
                                versionName '1.0.0'
                                versionCode 12
                            }
                    flavor2
                            {
                                dimension "business"
                                applicationId 'id2'
                                versionName '1.1.1'
                                versionCode 15
                            }
                }
        sourceSets { retail { java.srcDirs = ['...', '...'] } }
    }

dependencies {
...
}

apply plugin: 'com.google.gms.google-services'

Thanks a lot!

Best regards.

@aperomingo
Copy link

I have the same problem, I cant get my flavor version...
Is still unresolved?

@mortenholmgaard
Copy link

@cyrillekrasinski Please have a look at this issue

@DreamPWJ
Copy link

DreamPWJ commented Apr 30, 2021

I have the same problem, I cant get my flavor version...
Is still unresolved?@igor Lamos

@chrisbrkt
Copy link

For anyone searching for flavor support, you can use this plugin instead:
https://github.com/otkmnb2783/fastlane-plugin-android_versioning
If you migrated to a Kotlin gradle, you can use this:
https://github.com/mortenholmgaard/fastlane-plugin-android-versioning-kts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants