public class DefaultDexOptions extends java.lang.Object implements DexOptions
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
OPTIMIZE_WARNING |
| Constructor and Description |
|---|
DefaultDexOptions() |
| Modifier and Type | Method and Description |
|---|---|
static DefaultDexOptions |
copyOf(DexOptions dexOptions) |
java.util.List<java.lang.String> |
getAdditionalParameters()
List of additional parameters to be passed to
dx. |
boolean |
getDexInProcess()
Whether to run the
dx compiler as a separate process or inside the Gradle daemon JVM. |
java.lang.String |
getJavaMaxHeapSize()
Specifies the
-Xmx value when calling dx. |
boolean |
getJumboMode()
Enable jumbo mode in dx (
--force-jumbo). |
boolean |
getKeepRuntimeAnnotatedClasses()
Keep all classes with runtime annotations in the main dex in legacy multidex.
|
java.lang.Integer |
getMaxProcessCount()
Returns the maximum number of concurrent processes that can be used to dex.
|
java.lang.Boolean |
getOptimize()
Deprecated.
Dex is always optimized. This returns
true always. |
boolean |
getPreDexLibraries()
Whether to pre-dex libraries.
|
java.lang.Integer |
getThreadCount()
Number of threads to use when running dx.
|
void |
setAdditionalParameters(java.util.List<java.lang.String> additionalParameters) |
void |
setDexInProcess(boolean dexInProcess) |
void |
setJavaMaxHeapSize(java.lang.String javaMaxHeapSize) |
void |
setJumboMode(boolean jumboMode) |
void |
setKeepRuntimeAnnotatedClasses(boolean keepRuntimeAnnotatedClasses) |
void |
setMaxProcessCount(java.lang.Integer maxProcessCount) |
void |
setPreDexLibraries(boolean preDexLibraries) |
void |
setThreadCount(java.lang.Integer threadCount) |
public static final java.lang.String OPTIMIZE_WARNING
public static DefaultDexOptions copyOf(DexOptions dexOptions)
public boolean getPreDexLibraries()
getPreDexLibraries in interface DexOptionspublic void setPreDexLibraries(boolean preDexLibraries)
public boolean getJumboMode()
--force-jumbo).getJumboMode in interface DexOptionspublic void setJumboMode(boolean jumboMode)
public boolean getDexInProcess()
dx compiler as a separate process or inside the Gradle daemon JVM.
Running dx in-process can greatly improve performance, but is still experimental.
getDexInProcess in interface DexOptionspublic void setDexInProcess(boolean dexInProcess)
public boolean getKeepRuntimeAnnotatedClasses()
This is enabled by default and works around an issue that will cause the app to crash when using java.lang.reflect.Field.getDeclaredAnnotations on older android versions.
This can be disabled for for apps that do not use reflection and need more space in their main dex.
getKeepRuntimeAnnotatedClasses in interface DexOptionspublic void setKeepRuntimeAnnotatedClasses(boolean keepRuntimeAnnotatedClasses)
@Nullable public java.lang.Integer getThreadCount()
getThreadCount in interface DexOptionspublic void setThreadCount(java.lang.Integer threadCount)
@Nullable public java.lang.String getJavaMaxHeapSize()
-Xmx value when calling dx. Example value is "2048m".getJavaMaxHeapSize in interface DexOptionspublic void setJavaMaxHeapSize(java.lang.String javaMaxHeapSize)
@NonNull public java.util.List<java.lang.String> getAdditionalParameters()
dx.getAdditionalParameters in interface DexOptionspublic void setAdditionalParameters(@NonNull
java.util.List<java.lang.String> additionalParameters)
@Nullable public java.lang.Integer getMaxProcessCount()
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 = maxProcessCount * javaMaxHeapSize
To avoid thrashing, keep these two settings appropriate for your configuration.
getMaxProcessCount in interface DexOptionspublic void setMaxProcessCount(java.lang.Integer maxProcessCount)
@Deprecated @Nullable public java.lang.Boolean getOptimize()
true always.dx compiler with the --no-optimize flag.