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

Move flavor dimensions to another file #254

Open
vinifig opened this issue Apr 8, 2024 · 2 comments
Open

Move flavor dimensions to another file #254

vinifig opened this issue Apr 8, 2024 · 2 comments

Comments

@vinifig
Copy link
Contributor

vinifig commented Apr 8, 2024

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
Copy link
Contributor Author

vinifig commented Apr 8, 2024

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
Copy link
Contributor Author

vinifig commented Apr 8, 2024

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

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

No branches or pull requests

1 participant