use of com.taobao.android.builder.hook.dex.DexByteCodeConverterHook in project atlas by alibaba.
the class TransformReplacer method replaceDexTransform.
public void replaceDexTransform(AppVariantContext appVariantContext, BaseVariantOutput vod) {
List<TransformTask> baseTransforms = TransformManager.findTransformTaskByTransformType(variantContext, DexTransform.class);
DefaultDexOptions dexOptions = appVariantContext.getAppExtension().getDexOptions();
DexingType dexingType = appVariantContext.getScope().getDexingType();
DexByteCodeConverterHook dexByteCodeConverterHook = new DexByteCodeConverterHook(variantContext, variantContext.getAppVariantOutputContext(ApkDataUtils.get(vod)), LoggerWrapper.getLogger(DexByteCodeConverterHook.class), appVariantContext.getScope().getGlobalScope().getAndroidBuilder().getTargetInfo(), new GradleJavaProcessExecutor(appVariantContext.getProject()), appVariantContext.getProject().getLogger().isEnabled(LogLevel.INFO), new ExtraModelInfo(appVariantContext.getScope().getGlobalScope().getProjectOptions(), appVariantContext.getProject().getLogger()));
for (TransformTask transformTask : baseTransforms) {
DexTransform newTransform = new DexTransform(dexOptions, dexingType, false, appVariantContext.getProject().files(variantContext.getScope().getMainDexListFile()), verifyNotNull(appVariantContext.getScope().getGlobalScope().getAndroidBuilder().getTargetInfo(), "Target Info not set."), dexByteCodeConverterHook, appVariantContext.getScope().getGlobalScope().getAndroidBuilder().getErrorReporter(), variantContext.getScope().getMinSdkVersion().getFeatureLevel());
ReflectUtils.updateField(transformTask, "transform", newTransform);
}
}
Aggregations