Class DefaultDexOptions

java.lang.Object
com.android.builder.core.DefaultDexOptions
All Implemented Interfaces:
DexOptions

@Deprecated public class DefaultDexOptions extends Object implements DexOptions
Deprecated.
Concrete implementation of DexOptions.
  • Constructor Details

    • DefaultDexOptions

      public DefaultDexOptions()
      Deprecated.
  • Method Details

    • copyOf

      public static DefaultDexOptions copyOf(DexOptions dexOptions)
      Deprecated.
    • getPreDexLibraries

      public boolean getPreDexLibraries()
      Deprecated.
      Whether to pre-dex libraries. This can improve incremental builds, but clean builds may be slower.
      Specified by:
      getPreDexLibraries in interface DexOptions
    • setPreDexLibraries

      public void setPreDexLibraries(boolean preDexLibraries)
      Deprecated.
    • getJumboMode

      public boolean getJumboMode()
      Deprecated.
      Enable jumbo mode in dx (--force-jumbo).
      Specified by:
      getJumboMode in interface DexOptions
    • setJumboMode

      public void setJumboMode(boolean jumboMode)
      Deprecated.
    • getDexInProcess

      public boolean getDexInProcess()
      Deprecated.
      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.

      Specified by:
      getDexInProcess in interface DexOptions
    • setDexInProcess

      public void setDexInProcess(boolean dexInProcess)
      Deprecated.
    • getKeepRuntimeAnnotatedClasses

      public boolean getKeepRuntimeAnnotatedClasses()
      Deprecated.
      Keep all classes with runtime annotations in the main dex in legacy multidex.

      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.

      See http://b.android.com/78144.

      Specified by:
      getKeepRuntimeAnnotatedClasses in interface DexOptions
    • setKeepRuntimeAnnotatedClasses

      public void setKeepRuntimeAnnotatedClasses(boolean keepRuntimeAnnotatedClasses)
      Deprecated.
    • getThreadCount

      @Nullable public Integer getThreadCount()
      Deprecated.
      Number of threads to use when running dx. Defaults to 4.
      Specified by:
      getThreadCount in interface DexOptions
    • setThreadCount

      public void setThreadCount(Integer threadCount)
      Deprecated.
    • getJavaMaxHeapSize

      @Nullable public String getJavaMaxHeapSize()
      Deprecated.
      Specifies the -Xmx value when calling dx. Example value is "2048m".
      Specified by:
      getJavaMaxHeapSize in interface DexOptions
    • setJavaMaxHeapSize

      public void setJavaMaxHeapSize(String javaMaxHeapSize)
      Deprecated.
    • getAdditionalParameters

      @NonNull public List<String> getAdditionalParameters()
      Deprecated.
      List of additional parameters to be passed to dx.
      Specified by:
      getAdditionalParameters in interface DexOptions
    • setAdditionalParameters

      public void setAdditionalParameters(@NonNull List<String> additionalParameters)
      Deprecated.
    • getMaxProcessCount

      @Nullable public Integer getMaxProcessCount()
      Deprecated.
      Returns 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 = maxProcessCount * javaMaxHeapSize

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

      Specified by:
      getMaxProcessCount in interface DexOptions
      Returns:
      the max number of concurrent dx processes.
    • setMaxProcessCount

      public void setMaxProcessCount(Integer maxProcessCount)
      Deprecated.
    • getOptimize

      @Deprecated @Nullable public Boolean getOptimize()
      Deprecated.
      Dex is always optimized. This returns true always.
      Whether to run the dx compiler with the --no-optimize flag.