Search in sources :

Example 1 with OutputGroup

use of com.google.devtools.build.lib.buildeventstream.BuildEventStreamProtos.OutputGroup in project bazel by bazelbuild.

the class TargetCompleteEvent method getOutputFilesByGroup.

private Iterable<OutputGroup> getOutputFilesByGroup(PathConverter pathConverter) {
    ImmutableList.Builder<OutputGroup> groups = ImmutableList.builder();
    for (ArtifactsInOutputGroup artifactsInOutputGroup : outputs) {
        OutputGroup.Builder groupBuilder = OutputGroup.newBuilder();
        groupBuilder.setName(artifactsInOutputGroup.getOutputGroup());
        File.Builder fileBuilder = File.newBuilder();
        for (Artifact artifact : artifactsInOutputGroup.getArtifacts()) {
            String name = artifact.getFilename();
            String uri = pathConverter.apply(artifact.getPath());
            groupBuilder.addOutputFile(fileBuilder.setName(name).setUri(uri).build());
        }
        groups.add(groupBuilder.build());
    }
    return groups.build();
}
Also used : ImmutableList(com.google.common.collect.ImmutableList) ArtifactsInOutputGroup(com.google.devtools.build.lib.analysis.TopLevelArtifactHelper.ArtifactsInOutputGroup) OutputGroup(com.google.devtools.build.lib.buildeventstream.BuildEventStreamProtos.OutputGroup) ArtifactsInOutputGroup(com.google.devtools.build.lib.analysis.TopLevelArtifactHelper.ArtifactsInOutputGroup) File(com.google.devtools.build.lib.buildeventstream.BuildEventStreamProtos.File) Artifact(com.google.devtools.build.lib.actions.Artifact)

Aggregations

ImmutableList (com.google.common.collect.ImmutableList)1 Artifact (com.google.devtools.build.lib.actions.Artifact)1 ArtifactsInOutputGroup (com.google.devtools.build.lib.analysis.TopLevelArtifactHelper.ArtifactsInOutputGroup)1 File (com.google.devtools.build.lib.buildeventstream.BuildEventStreamProtos.File)1 OutputGroup (com.google.devtools.build.lib.buildeventstream.BuildEventStreamProtos.OutputGroup)1