@NonNull @Override public Map<String, Object> getParameterInputs() { try { // ATTENTION: if you add something here, consider adding the value to DexKey - it needs // to be saved if affects how dx is invoked. Map<String, Object> params = Maps.newHashMapWithExpectedSize(4); params.put("optimize", true); params.put("predex", dexOptions.getPreDexLibraries()); params.put("jumbo", dexOptions.getJumboMode()); params.put("multidex", multiDex); params.put("multidex-legacy", multiDex && mainDexListFile != null); params.put("java-max-heap-size", dexOptions.getJavaMaxHeapSize()); params.put( "additional-parameters", Iterables.toString(dexOptions.getAdditionalParameters())); TargetInfo targetInfo = androidBuilder.getTargetInfo(); Preconditions.checkState(targetInfo != null, "androidBuilder.targetInfo required for task '%s'.", getName()); BuildToolInfo buildTools = targetInfo.getBuildTools(); params.put("build-tools", buildTools.getRevision().toString()); return params; } catch (Exception e) { throw new RuntimeException(e); } }
public void runDexer( @NonNull final DexProcessBuilder builder, @NonNull final DexOptions dexOptions, @NonNull final ProcessOutputHandler processOutputHandler) throws ProcessException, IOException, InterruptedException { initDexExecutorService(dexOptions); if (dexOptions.getAdditionalParameters().contains("--no-optimize")) { mLogger.warning(DefaultDexOptions.OPTIMIZE_WARNING); } if (shouldDexInProcess(dexOptions)) { dexInProcess(builder, dexOptions, processOutputHandler); } else { dexOutOfProcess(builder, dexOptions, processOutputHandler); } }
args.forceJumbo = dexOptions.getJumboMode(); args.parseFlags(Iterables.toArray(dexOptions.getAdditionalParameters(), String.class)); args.makeOptionsObjects(dxContext);
.putBoolean(FileCacheInputParams.MULTI_DEX.name(), multiDex); List<String> additionalParams = dexOptions.getAdditionalParameters(); for (int i = 0; i < additionalParams.size(); i++) { buildCacheInputs.putString(
for (String arg : dexOptions.getAdditionalParameters()) { builder.addArgs(arg);
dexOptions.getJumboMode(), optimize, dexOptions.getAdditionalParameters(), multiDex);
public static DefaultDexOptions copyOf(DexOptions dexOptions) { DefaultDexOptions result = new DefaultDexOptions(); result.setPreDexLibraries(dexOptions.getPreDexLibraries()); result.setJumboMode(dexOptions.getJumboMode()); result.setDexInProcess(dexOptions.getDexInProcess()); result.setThreadCount(dexOptions.getThreadCount()); result.setJavaMaxHeapSize(dexOptions.getJavaMaxHeapSize()); result.setAdditionalParameters(dexOptions.getAdditionalParameters()); result.setMaxProcessCount(dexOptions.getMaxProcessCount()); result.setKeepRuntimeAnnotatedClasses( dexOptions.getKeepRuntimeAnnotatedClasses()); return result; }