What are the meaning of the dexOptions.incremental, etc. Any body can explain them to me.
dex options
android {
dexOptions {
incremental false
preDexLibraries = false
jumboMode = false
javaMaxHeapSize "2048M"
}
}
This affects all tasks using dex.
boolean incremental
Whether to enable the incremental mode for dx. This has many limitations and may not work. Use carefully.
String javaMaxHeapSize
Sets the -JXmx* value when calling dx. Format should follow the 1024M pattern.
boolean jumboMode
Enable jumbo mode in dx (--force-jumbo).
boolean preDexLibraries
Whether to pre-dex libraries. This can improve incremental builds, but clean builds may be slower.
These can be found here:
http://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.DexOptions.html
set incremental
to true
.
This is experimental feature that is disabled by default. However you can enable it. I personally didn't noticed any changes in term of speed (if it affect the speed).
More explanation can be found there https://stackoverflow.com/a/24224385/513413.
Example:
dexOptions {
preDexLibraries = false
incremental true
javaMaxHeapSize "12g"
}
afterEvaluate {
tasks.matching {
it.name.startsWith('dex')
}.each { dx ->
if (dx.additionalParameters == null) {
dx.additionalParameters = ['--multi-dex']
} else {
dx.additionalParameters += '--multi-dex'
}
}
}
来源:https://stackoverflow.com/questions/28927255/how-can-i-use-android-dexoptions