DexOptions

DSL object for configuring dx options.

Properties

PropertyDescription
dexInProcess

Whether to run the dx compiler as a separate process or inside the Gradle daemon JVM.

javaMaxHeapSize

Specifies the -Xmx value when calling dx. Example value is "2048m".

jumboMode

Enable jumbo mode in dx (--force-jumbo).

maxProcessCount

The maximum number of concurrent processes that can be used to dex. Defaults to 4.

preDexLibraries

Whether to pre-dex libraries. This can improve incremental builds, but clean builds may be slower.

threadCount

Number of threads to use when running dx. Defaults to 4.

Methods

No methods

Script blocks

No script blocks

Property details

boolean dexInProcess

Whether to run the dx compiler as a separate process or inside the Gradle daemon JVM.

Running dx in-process can greatly improve performance, but is still experimental.

String javaMaxHeapSize

Specifies the -Xmx value when calling dx. Example value is "2048m".

boolean jumboMode

Enable jumbo mode in dx (--force-jumbo).

Integer maxProcessCount

The maximum number of concurrent processes that can be used to dex. Defaults to 4.

Be aware that the number of concurrent process times the memory requirement represent the minimum amount of memory that will be used by the dx processes:

Total Memory = getMaxProcessCount() * getJavaMaxHeapSize()

To avoid trashing, keep these two settings appropriate for your configuration.

boolean preDexLibraries

Whether to pre-dex libraries. This can improve incremental builds, but clean builds may be slower.

Integer threadCount

Number of threads to use when running dx. Defaults to 4.