I want to use the incremental dex option but because its still experimental I only want it enabled when doing debug builds. However, I can't find a way to reference the current buildType in the context of the dex options.
Something like this, is it possible?
android {
....
dexOptions{
if(buildType.name == 'debug') incremental = true
}
}
I believe I found a solution. Builds seem faster but I don't see any log messages to indicate incremental dex is working.
applicationVariants.all { variant ->
if (variant.buildType.name == 'debug'){
variant.dex.enableIncremental = true
variant.dex.dexOptions.incremental = true
variant.dex.dexOptions.preDexLibraries = true
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With