use of org.gradle.api.DefaultTask in project atlas by alibaba.
the class MtlParallelTask method run.
@TaskAction
void run() {
if (null == parallelTask || parallelTask.isEmpty()) {
return;
}
if (concurrent) {
String taskName = uniqueTaskName;
if (StringUtils.isEmpty(taskName)) {
taskName = parallelTask.get(0).getClass().getSimpleName();
}
parallelTask.forEach(task -> waitableExecutor.execute((Callable) () -> {
task.execute();
return null;
}));
try {
waitableExecutor.waitForTasksWithQuickFail(true);
} catch (InterruptedException e) {
e.printStackTrace();
}
} else {
for (final DefaultTask task : parallelTask) {
task.execute();
}
}
}
use of org.gradle.api.DefaultTask in project atlas by alibaba.
the class MergeManifestAwbsConfigAction method execute.
@Override
public void execute(MtlParallelTask parallelTask) {
super.execute(parallelTask);
AtlasDependencyTree atlasDependencyTree = AtlasBuildContext.androidDependencyTrees.get(parallelTask.getVariantName());
if (null == atlasDependencyTree) {
return;
}
List<DefaultTask> tasks = new ArrayList<DefaultTask>();
AppVariantOutputContext appVariantOutputContext = getAppVariantOutputContext();
for (final AwbBundle awbBundle : atlasDependencyTree.getAwbBundles()) {
MergeAwbManifests.ConfigAction configAction = new MergeAwbManifests.ConfigAction(appVariantOutputContext.getScope(), awbBundle, appVariantOutputContext);
MergeAwbManifests mergeAwbManifests = TaskCreater.create(appVariantContext.getProject(), configAction.getName(), configAction.getType());
configAction.execute(mergeAwbManifests);
tasks.add(mergeAwbManifests);
}
parallelTask.parallelTask = tasks;
parallelTask.uniqueTaskName = getName();
}
use of org.gradle.api.DefaultTask in project atlas by alibaba.
the class MergeAwbsJniFolder method execute.
@Override
public void execute(MtlParallelTask parallelTask) {
super.execute(parallelTask);
AtlasDependencyTree atlasDependencyTree = AtlasBuildContext.androidDependencyTrees.get(parallelTask.getVariantName());
if (null == atlasDependencyTree) {
return;
}
List<DefaultTask> tasks = new ArrayList<DefaultTask>();
for (final AwbBundle awbBundle : atlasDependencyTree.getAwbBundles()) {
MergeAwbAssets.MergeAwbJniLibFoldersConfigAction mergeAwbJniLibFoldersConfigAction = new MergeAwbAssets.MergeAwbJniLibFoldersConfigAction(appVariantContext, baseVariantOutput, awbBundle);
MergeAwbAssets mergeTask = TaskCreater.create(appVariantContext.getProject(), mergeAwbJniLibFoldersConfigAction.getName(), mergeAwbJniLibFoldersConfigAction.getType());
mergeAwbJniLibFoldersConfigAction.execute(mergeTask);
tasks.add(mergeTask);
}
parallelTask.parallelTask = tasks;
parallelTask.concurrent = false;
parallelTask.uniqueTaskName = getName();
}
Aggregations