flutter_flavorizr icon indicating copy to clipboard operation
flutter_flavorizr copied to clipboard

Move flavor dimensions to another file

Open vinifig opened this issue 10 months ago • 2 comments

Hello!

I have an application with more than 30 flavors, there's some automations I'm doing via flavorizr + local scripts so I can structure it better.

Recently I'm having a lot of trouble solving Git conflicts in the application build.gradle due to the size of these flavors config + our application dependencies.

I think that creating an product-flavors.gradle and applying it on build.gradle would organize it better and make it simpler to do Android changes in the project.

Do you guys have an suggestion of how I can organize it or examples in big projects like mine?

If you think it's plausible I can open a PR with this change

vinifig avatar Apr 08 '24 18:04 vinifig

example:

product-flavors.gradle:

android {
    flavorDimensions "flavor-type"
    productFlavors {
        dev {
            dimension "flavor-type"
            applicationId "com.app.dev"
            resValue "string", "app_name", "app dev"
        }
        hml {
            dimension "flavor-type"
            applicationId "com.app.hml"
            resValue "string", "app_name", "app hml"
        }
        prd {
            dimension "flavor-type"
            applicationId "com.app.dev"
            resValue "string", "app_name", "app hml"
        }
    }
}

build.gradle:

// ----- BEGIN flavorDimensions (autogenerated by flutter_flavorizr) -----
apply from: 'product-flavors.gradle'
// ----- END flavorDimensions (autogenerated by flutter_flavorizr) -----

vinifig avatar Apr 08 '24 18:04 vinifig

I have an android project tha does it exactly like this. It's far easier to manage and we can separate the Library changes from the application changes

vinifig avatar Apr 08 '24 18:04 vinifig