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()));
}
}
}
Aggregations