Search in sources :

Example 1 with JavaSourcePackage

use of com.google.devtools.intellij.ideinfo.IntellijIdeInfo.JavaSourcePackage in project intellij by bazelbuild.

the class PackageManifestReader method parseManifestFile.

private static Map<ArtifactLocation, String> parseManifestFile(File packageManifest) {
    Map<ArtifactLocation, String> outputMap = Maps.newHashMap();
    InputStreamProvider inputStreamProvider = InputStreamProvider.getInstance();
    try (InputStream input = inputStreamProvider.getFile(packageManifest)) {
        try (BufferedInputStream bufferedInputStream = new BufferedInputStream(input)) {
            PackageManifest proto = PackageManifest.parseFrom(bufferedInputStream);
            for (JavaSourcePackage source : proto.getSourcesList()) {
                outputMap.put(fromProto(source.getArtifactLocation()), source.getPackageString());
            }
        }
        return outputMap;
    } catch (IOException e) {
        logger.error(e);
        return outputMap;
    }
}
Also used : InputStreamProvider(com.google.idea.blaze.base.io.InputStreamProvider) BufferedInputStream(java.io.BufferedInputStream) BufferedInputStream(java.io.BufferedInputStream) InputStream(java.io.InputStream) PackageManifest(com.google.devtools.intellij.ideinfo.IntellijIdeInfo.PackageManifest) ArtifactLocation(com.google.idea.blaze.base.ideinfo.ArtifactLocation) JavaSourcePackage(com.google.devtools.intellij.ideinfo.IntellijIdeInfo.JavaSourcePackage) IOException(java.io.IOException)

Aggregations

JavaSourcePackage (com.google.devtools.intellij.ideinfo.IntellijIdeInfo.JavaSourcePackage)1 PackageManifest (com.google.devtools.intellij.ideinfo.IntellijIdeInfo.PackageManifest)1 ArtifactLocation (com.google.idea.blaze.base.ideinfo.ArtifactLocation)1 InputStreamProvider (com.google.idea.blaze.base.io.InputStreamProvider)1 BufferedInputStream (java.io.BufferedInputStream)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1