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

  1. can determine build type @ runtime in build.gradle, , conditionally set versioncode depending on buildtype. i.e debug vs release_beta.

something like...

    defaultconfig{       if(buildtypes.name == "release_beta"){         versioncode buildversioncode()       }else{        versioncode 99999999999       }     } 
  1. 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

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -