How to build various variants of android via gradle

I already have it

2 flavors (staging, production)

2 buildTypes (debug, release)

Apart from that, I want to have different options, for example for different suppliers. as release build for samsung and htc. is this possible with build scripts?

PS: I don't want to use a third party plugin like this

+3


source to share


1 answer


You can use flavor sizes.



android {
    flavorDimensions 'environment', 'vendor'

    productFlavors {
        staging {
            flavorDimension 'environment'
        }

        production {
            flavorDimension 'environment'
        }

        htc {
            flavorDimension 'vendor'
        }

        samsung {
            flavorDimension 'vendor'
        }
    }
}

      

+3


source







All Articles