Search in sources :

Example 1 with DesugarWorkerItem

use of com.android.build.gradle.internal.transforms.DesugarWorkerItem in project atlas by alibaba.

the class AtlasDesugarTransform method processNonCachedOnesWithGradleExecutor.

private void processNonCachedOnesWithGradleExecutor(WorkerExecutor workerExecutor, List<Path> classpath) throws IOException, ProcessException, ExecutionException {
    List<Path> desugarBootclasspath = getBootclasspath();
    for (AtlasDesugarTransform.InputEntry pathPathEntry : cacheMisses) {
        DesugarWorkerItem workerItem = new DesugarWorkerItem(desugarJar.get(), PathUtils.createTmpDirToRemoveOnShutdown("gradle_lambdas"), true, pathPathEntry.getInputPath(), pathPathEntry.getOutputPath(), classpath, desugarBootclasspath, minSdk);
        workerExecutor.submit(DesugarWorkerItem.DesugarAction.class, workerItem::configure);
    }
    workerExecutor.await();
    for (AtlasDesugarTransform.InputEntry e : cacheMisses) {
        if (e.getCache() != null && e.getInputs() != null) {
            e.getCache().createFileInCacheIfAbsent(e.getInputs(), in -> Files.copy(e.getOutputPath(), in.toPath()));
        }
    }
}
Also used : Path(java.nio.file.Path) DesugarWorkerItem(com.android.build.gradle.internal.transforms.DesugarWorkerItem)

Aggregations

DesugarWorkerItem (com.android.build.gradle.internal.transforms.DesugarWorkerItem)1 Path (java.nio.file.Path)1