use of com.taobao.android.builder.tasks.app.MtlParallelTask in project atlas by alibaba.
the class MergeResAwbsConfigAction method execute.
@Override
public void execute(MtlParallelTask parallelTask) {
super.execute(parallelTask);
AndroidDependencyTree androidDependencyTree = AtlasBuildContext.androidDependencyTrees.get(parallelTask.getVariantName());
if (null == androidDependencyTree) {
return;
}
List<DefaultTask> tasks = new ArrayList<DefaultTask>();
for (final AwbBundle awbBundle : androidDependencyTree.getAwbBundles()) {
MergeAwbResourceConfigAction mergeAwbResourceConfigAction = new MergeAwbResourceConfigAction(appVariantContext, baseVariantOutputData, awbBundle);
final MergeResources mergeTask = TaskCreater.create(appVariantContext.getProject(), mergeAwbResourceConfigAction.getName(), mergeAwbResourceConfigAction.getType());
mergeAwbResourceConfigAction.execute(mergeTask);
tasks.add(mergeTask);
mergeTask.doLast(new Action<Task>() {
@Override
public void execute(Task task) {
File publicRes = new File(awbBundle.getResFolder(), "values/public.xml");
if (publicRes.exists()) {
try {
FileUtils.copyFile(publicRes, new File(mergeTask.getOutputDir(), "values/public.xml"));
} catch (IOException e) {
e.printStackTrace();
}
}
}
});
}
parallelTask.parallelTask = tasks;
parallelTask.uniqueTaskName = getName();
parallelTask.concurrent = true;
}
Aggregations