use of com.taobao.android.builder.tasks.transform.dex.AtlasDexArchiveBuilderTransform in project atlas by alibaba.
the class TransformReplacer method replaceDexArchiveBuilderTransform.
public void replaceDexArchiveBuilderTransform(BaseVariantOutput vod) {
List<TransformTask> list = TransformManager.findTransformTaskByTransformType(variantContext, DexArchiveBuilderTransform.class);
DefaultDexOptions dexOptions = variantContext.getAppExtension().getDexOptions();
boolean minified = variantContext.getScope().getCodeShrinker() != null;
ProjectOptions projectOptions = variantContext.getScope().getGlobalScope().getProjectOptions();
FileCache userLevelCache = getUserDexCache(minified, dexOptions.getPreDexLibraries());
for (TransformTask transformTask : list) {
AtlasDexArchiveBuilderTransform atlasDexArchiveBuilderTransform = new AtlasDexArchiveBuilderTransform(variantContext, vod, dexOptions, variantContext.getScope().getGlobalScope().getAndroidBuilder().getErrorReporter(), userLevelCache, variantContext.getScope().getMinSdkVersion().getFeatureLevel(), variantContext.getScope().getDexer(), projectOptions.get(BooleanOption.ENABLE_GRADLE_WORKERS), projectOptions.get(IntegerOption.DEXING_READ_BUFFER_SIZE), projectOptions.get(IntegerOption.DEXING_WRITE_BUFFER_SIZE), variantContext.getScope().getVariantConfiguration().getBuildType().isDebuggable());
atlasDexArchiveBuilderTransform.setTransformTask(transformTask);
ReflectUtils.updateField(transformTask, "transform", atlasDexArchiveBuilderTransform);
if (variantContext.getScope().getInstantRunBuildContext().isInInstantRunMode() && variantContext.getVariantConfiguration().getMinSdkVersion().getApiLevel() < 21) {
transformTask.doLast(task -> {
task.getLogger().info("generate maindexList......");
generateMainDexList(variantContext.getScope());
});
}
}
}
Aggregations