public class SmartDexingStep extends Object implements Step
This is most appropriately represented as a build rule itself (which depends on individual dex rules) however this would require significant refactoring of AndroidBinaryRule that would be disruptive to other initiatives in flight (namely, ApkBuilder). It is also debatable that it is even the right course of action given that it would require dynamically modifying the DAG.
Modifier and Type | Class and Description |
---|---|
static interface |
SmartDexingStep.DexInputHashesProvider |
Modifier and Type | Field and Description |
---|---|
static String |
SHORT_NAME |
Constructor and Description |
---|
SmartDexingStep(AndroidPlatformTarget androidPlatformTarget,
BuildContext buildContext,
ProjectFilesystem filesystem,
Optional<Path> primaryOutputPath,
Optional<java.util.function.Supplier<Set<Path>>> primaryInputsToDex,
Optional<java.util.function.Supplier<List<String>>> primaryDexWeightsSupplier,
Optional<Path> secondaryOutputDir,
Optional<java.util.function.Supplier<com.google.common.collect.Multimap<Path,Path>>> secondaryInputsToDex,
SmartDexingStep.DexInputHashesProvider dexInputHashesProvider,
Path successDir,
EnumSet<DxStep.Option> dxOptions,
com.google.common.util.concurrent.ListeningExecutorService executorService,
int xzCompressionLevel,
Optional<String> dxMaxHeapSize,
String dexTool,
boolean desugarInterfaceMethods,
boolean useDexBuckedId,
Optional<Set<Path>> additonalDesugarDeps,
BuildTarget buildTarget,
Optional<Integer> minSdkVersion) |
Modifier and Type | Method and Description |
---|---|
static int |
determineOptimalThreadCount() |
StepExecutionResult |
execute(ExecutionContext context) |
String |
getDescription(ExecutionContext context) |
String |
getShortName() |
public static final String SHORT_NAME
public SmartDexingStep(AndroidPlatformTarget androidPlatformTarget, BuildContext buildContext, ProjectFilesystem filesystem, Optional<Path> primaryOutputPath, Optional<java.util.function.Supplier<Set<Path>>> primaryInputsToDex, Optional<java.util.function.Supplier<List<String>>> primaryDexWeightsSupplier, Optional<Path> secondaryOutputDir, Optional<java.util.function.Supplier<com.google.common.collect.Multimap<Path,Path>>> secondaryInputsToDex, SmartDexingStep.DexInputHashesProvider dexInputHashesProvider, Path successDir, EnumSet<DxStep.Option> dxOptions, com.google.common.util.concurrent.ListeningExecutorService executorService, int xzCompressionLevel, Optional<String> dxMaxHeapSize, String dexTool, boolean desugarInterfaceMethods, boolean useDexBuckedId, Optional<Set<Path>> additonalDesugarDeps, BuildTarget buildTarget, Optional<Integer> minSdkVersion)
primaryOutputPath
- Path for the primary dex artifact.primaryInputsToDex
- Set of paths to include as inputs for the primary dex artifact.secondaryOutputDir
- Directory path for the secondary dex artifacts, if there are any.
Note that this directory will be pruned such that only those secondary outputs generated by
this command will remain in the directory!secondaryInputsToDex
- List of paths to input jar files, to use as dx input, keyed by the
corresponding output dex file. Note that for each output file (key), a separate dx
invocation will be started with the corresponding jar files (value) as the input.successDir
- Directory where success artifacts are written.executorService
- The thread pool to execute the dx command on.minSdkVersion
- public static int determineOptimalThreadCount()
public StepExecutionResult execute(ExecutionContext context) throws IOException, InterruptedException
execute
in interface Step
IOException
InterruptedException
public String getShortName()
getShortName
in interface Step
public String getDescription(ExecutionContext context)
getDescription
in interface Step