android - How to test if we are doing a release build in Gradle -


i need build operations during release build speed routine debug build. how test, if i'm doing release build in build.gradle script?

splits {     abi {         enable /* condition here ->  */ true         reset()         include 'x86', 'armeabi-v7a', 'mips'         universalapk true     } } 

i found example here, don't want set build property, prefer automatic.

please try:

splits {     abi {         if (project.gradle.startparameter.tasknames.any { it.tolowercase().contains('release') }) {             enable true             reset()             include 'x86', 'armeabi-v7a', 'mips'             universalapk true         } else {             enable true             reset()             include 'armeabi-v7a'             universalapk false         }     } } 

however, mind fact configuration doesn't take task dependencies account. mean task may depend on release task , if isn't passed via command line might executed.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -