Search in sources :

Example 1 with ManifestFileObject

use of com.taobao.android.builder.tools.manifest.ManifestFileObject in project atlas by alibaba.

the class PreProcessManifestTask method preProcess.

@TaskAction
public void preProcess() throws IOException, DocumentException, InterruptedException {
    getLogger().info("[MTLPlugin]Start PreProcess Lib manifest files,main manifestFile is:" + getMainManifestFile());
    ExecutorServicesHelper executorServicesHelper = new ExecutorServicesHelper("preProcessDex", getLogger(), 0);
    List<Runnable> runnables = new ArrayList<>();
    ManifestFileObject mainManifestFileObject = ManifestFileUtils.getManifestFileObject(mainManifestFile);
    mainManifestFileObject.init();
    for (File file : getLibraryManifests()) {
        runnables.add(new Runnable() {

            @Override
            public void run() {
                try {
                    ManifestFileUtils.updatePreProcessManifestFile(file, mainManifestFileObject, true);
                } catch (Throwable e) {
                    throw new GradleException("preprocess manifest", e);
                }
            }
        });
    }
    executorServicesHelper.execute(runnables);
    //ManifestFileUtils.preProcessManifests(getMainManifestFile(), getLibraryManifests(), true);
    //BundleInfoUtils.setupAwbBundleInfos(appVariantOutputContext.getVariantContext());
    //collectBundleInfo();
    addAwbManifest2Merge();
}
Also used : ExecutorServicesHelper(com.taobao.android.builder.tools.concurrent.ExecutorServicesHelper) ManifestFileObject(com.taobao.android.builder.tools.manifest.ManifestFileObject) GradleException(org.gradle.api.GradleException) ArrayList(java.util.ArrayList) File(java.io.File) InputFile(org.gradle.api.tasks.InputFile) MtlBaseTaskAction(com.taobao.android.builder.tasks.manager.MtlBaseTaskAction) TaskAction(org.gradle.api.tasks.TaskAction)

Aggregations

MtlBaseTaskAction (com.taobao.android.builder.tasks.manager.MtlBaseTaskAction)1 ExecutorServicesHelper (com.taobao.android.builder.tools.concurrent.ExecutorServicesHelper)1 ManifestFileObject (com.taobao.android.builder.tools.manifest.ManifestFileObject)1 File (java.io.File)1 ArrayList (java.util.ArrayList)1 GradleException (org.gradle.api.GradleException)1 InputFile (org.gradle.api.tasks.InputFile)1 TaskAction (org.gradle.api.tasks.TaskAction)1