Gradle: How do I define build type for specific flavors only?

Viewed 1484

I have been using gradle for creating different build variants for different companies for an Android app.

For example I have build flavors:

  • Company1
  • Company2

And then I have build types:

  • Production
  • Preview
  • Development

So this will create 6 build variants:

  • Company1Production
  • Company1Preview
  • Company1Development
  • Company2Production
  • Company2Preview
  • Company2Development

So the question is: Actually I don't need the development build type for company 2, I only need it for company 1.

Is there a way I can specify only company 1 have the development build type?

I have a lot of companies in my projects, some of the build type just don't make sense for those companies, and it confuses people who want to build the app.

2 Answers
Related