use of com.taobao.android.builder.tasks.transform.dex.AtlasDexMergerTransform in project atlas by alibaba.
the class TransformReplacer method replaceDexMerge.
public void replaceDexMerge(BaseVariantOutput vod) {
List<TransformTask> list = TransformManager.findTransformTaskByTransformType(variantContext, DexMergerTransform.class);
DexingType dexingType = variantContext.getScope().getDexingType();
if (variantContext.getScope().getInstantRunBuildContext().isInInstantRunMode() && variantContext.getVariantConfiguration().getMinSdkVersion().getApiLevel() < 21) {
dexingType = DexingType.LEGACY_MULTIDEX;
}
DexMergerTool dexMergerTool = variantContext.getScope().getDexMerger();
int sdkVerision = variantContext.getScope().getMinSdkVersion().getFeatureLevel();
boolean debug = variantContext.getScope().getVariantConfiguration().getBuildType().isDebuggable();
ErrorReporter errorReporter = variantContext.getScope().getGlobalScope().getAndroidBuilder().getErrorReporter();
for (TransformTask transformTask : list) {
AtlasDexMergerTransform dexMergerTransform = new AtlasDexMergerTransform(variantContext.getAppVariantOutputContext(ApkDataUtils.get(vod)), dexingType, dexingType == DexingType.LEGACY_MULTIDEX ? variantContext.getProject().files(variantContext.getScope().getMainDexListFile()) : null, errorReporter, dexMergerTool, sdkVerision, debug);
ReflectUtils.updateField(transformTask, "transform", dexMergerTransform);
}
}
Aggregations