Search in sources :

Example 1 with DataBindingProcessLayoutsTask

use of com.android.build.gradle.internal.tasks.databinding.DataBindingProcessLayoutsTask in project atlas by alibaba.

the class DataBindingProcessLayoutAwbsConfigAction method execute.

@Override
public void execute(MtlParallelTask parallelTask) {
    super.execute(parallelTask);
    AndroidDependencyTree androidDependencyTree = AtlasBuildContext.androidDependencyTrees.get(parallelTask.getVariantName());
    if (null == androidDependencyTree) {
        return;
    }
    DataBindingBuilder dataBindingBuilder = new DataBindingBuilder();
    dataBindingBuilder.setPrintMachineReadableOutput(false);
    dataBindingBuilder.setDebugLogEnabled(appVariantContext.getProject().getLogger().isDebugEnabled());
    List<DefaultTask> tasks = new ArrayList<DefaultTask>();
    for (final AwbBundle awbBundle : androidDependencyTree.getAwbBundles()) {
        AwbDataBindingProcessLayoutsConfigAction processLayoutsConfigAction = new AwbDataBindingProcessLayoutsConfigAction(appVariantContext, awbBundle, dataBindingBuilder);
        DataBindingProcessLayoutsTask dataBindingProcessLayoutsTask = TaskCreater.create(appVariantContext.getProject(), processLayoutsConfigAction.getName(), processLayoutsConfigAction.getType());
        processLayoutsConfigAction.execute(dataBindingProcessLayoutsTask);
        tasks.add(dataBindingProcessLayoutsTask);
    }
    parallelTask.parallelTask = tasks;
    parallelTask.uniqueTaskName = getName();
    parallelTask.concurrent = true;
}
Also used : ArrayList(java.util.ArrayList) DefaultTask(org.gradle.api.DefaultTask) DataBindingProcessLayoutsTask(com.android.build.gradle.internal.tasks.databinding.DataBindingProcessLayoutsTask) AndroidDependencyTree(com.taobao.android.builder.dependency.AndroidDependencyTree) DataBindingBuilder(android.databinding.tool.DataBindingBuilder) AwbBundle(com.taobao.android.builder.dependency.model.AwbBundle)

Aggregations

DataBindingBuilder (android.databinding.tool.DataBindingBuilder)1 DataBindingProcessLayoutsTask (com.android.build.gradle.internal.tasks.databinding.DataBindingProcessLayoutsTask)1 AndroidDependencyTree (com.taobao.android.builder.dependency.AndroidDependencyTree)1 AwbBundle (com.taobao.android.builder.dependency.model.AwbBundle)1 ArrayList (java.util.ArrayList)1 DefaultTask (org.gradle.api.DefaultTask)1