use of com.google.idea.blaze.base.model.BlazeLibrary in project intellij by bazelbuild.
the class UnpackedAars method getArtifactsToCache.
/**
* Returns a map from cache key to {@link AarLibraryContents}, for all the artifacts which should
* be cached.
*/
private static ImmutableMap<String, AarLibraryContents> getArtifactsToCache(ProjectViewSet projectViewSet, BlazeProjectData projectData) {
Collection<BlazeLibrary> libraries = BlazeLibraryCollector.getLibraries(projectViewSet, projectData);
List<AarLibrary> aarLibraries = libraries.stream().filter(library -> library instanceof AarLibrary).map(library -> (AarLibrary) library).collect(Collectors.toList());
ArtifactLocationDecoder decoder = projectData.getArtifactLocationDecoder();
Map<String, AarLibraryContents> outputs = new HashMap<>();
for (AarLibrary library : aarLibraries) {
BlazeArtifact aar = decoder.resolveOutput(library.aarArtifact);
BlazeArtifact jar = library.libraryArtifact != null ? decoder.resolveOutput(library.libraryArtifact.jarForIntellijLibrary()) : null;
outputs.put(UnpackedAarUtils.getAarDirName(aar), AarLibraryContents.create(aar, jar));
}
return ImmutableMap.copyOf(outputs);
}
Aggregations