use of com.android.build.api.transform.QualifiedContent in project atlas by alibaba.
the class AtlasDexArchiveBuilderCacheHander method populateCache.
void populateCache(Multimap<QualifiedContent, File> cacheableItems) throws Exception {
for (QualifiedContent input : cacheableItems.keys()) {
FileCache cache = getBuildCache(input.getFile(), isExternalLib(input), userLevelCache);
if (cache != null) {
FileCache.Inputs buildCacheInputs = AtlasDexArchiveBuilderCacheHander.getBuildCacheInputs(input.getFile(), dexOptions, dexer, minSdkVersion, isDebuggable);
FileCache.QueryResult result = cache.createFileInCacheIfAbsent(buildCacheInputs, in -> {
Collection<File> dexArchives = cacheableItems.get(input);
logger.verbose("Merging %1$s into %2$s", Joiner.on(',').join(dexArchives), in.getAbsolutePath());
mergeJars(in, cacheableItems.get(input));
});
if (result.getQueryEvent().equals(FileCache.QueryEvent.CORRUPTED)) {
Verify.verifyNotNull(result.getCauseOfCorruption());
logger.info("The build cache at '%1$s' contained an invalid cache entry.\n" + "Cause: %2$s\n" + "We have recreated the cache entry.\n" + "%3$s", cache.getCacheDirectory().getAbsolutePath(), Throwables.getStackTraceAsString(result.getCauseOfCorruption()), BuildCacheUtils.BUILD_CACHE_TROUBLESHOOTING_MESSAGE);
}
}
}
}
Aggregations