android - Can I determine my app's buildType in my build.gradle at run time? -
i need able bump versioncode particular buildtype called "release_beta
". have function bumps fine. i've discovered buildtypes doesn't let override versioncode. also, i'm running lot of different flavors. not want handle versioncode in more flavor variants.
this not allowed.
buildtypes { release_beta { minifyenabled false testcoverageenabled false signingconfig signingconfigs.release_beta versioncode buildversioncode() }
the options see left are
- can determine build type @ runtime in
build.gradle
, , conditionally set versioncode depending onbuildtype
. i.e debug vs release_beta.
something like...
defaultconfig{ if(buildtypes.name == "release_beta"){ versioncode buildversioncode() }else{ versioncode 99999999999 } }
- can have config besides
defaultconfig
, , apply build type, can set different versioncode release_beta buildtype.
something like...
buildtypes { release_beta { minifyenabled false testcoverageenabled false defaultconfig{ versioncode buildversioncode() }
Comments
Post a Comment