aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/runtime/NamedArtifactGroup.java
diff options
context:
space:
mode:
authorGravatar ulfjack <ulfjack@google.com>2018-06-15 01:40:02 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-06-15 01:41:16 -0700
commit68aa410229cb36ceedc910c803a0aff2db6d027f (patch)
tree3fa7f6805066a96966e9fa4191774a4b1c06d2cf /src/main/java/com/google/devtools/build/lib/runtime/NamedArtifactGroup.java
parent522f76ae5e50ae9848b6f407acbcce62bb808016 (diff)
Add a mechanism for build event protocol events to upload files
This should be a no-op, mostly replacing PathConverter with BuildEventArtifactUploader, since none of the implementations perform any upload yet. PiperOrigin-RevId: 200685325
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/runtime/NamedArtifactGroup.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/runtime/NamedArtifactGroup.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/NamedArtifactGroup.java b/src/main/java/com/google/devtools/build/lib/runtime/NamedArtifactGroup.java
index b990c15c7b..431b4276ad 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/NamedArtifactGroup.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/NamedArtifactGroup.java
@@ -25,6 +25,7 @@ import com.google.devtools.build.lib.buildeventstream.BuildEventStreamProtos;
import com.google.devtools.build.lib.buildeventstream.GenericBuildEvent;
import com.google.devtools.build.lib.buildeventstream.PathConverter;
import com.google.devtools.build.lib.collect.nestedset.NestedSetView;
+import com.google.devtools.build.lib.vfs.Path;
import java.util.Collection;
/**
@@ -52,6 +53,19 @@ class NamedArtifactGroup implements BuildEvent {
}
@Override
+ public ImmutableSet<Path> referencedLocalFiles() {
+ // This has to be consistent with the code below.
+ ImmutableSet.Builder<Path> artifacts = ImmutableSet.builder();
+ for (Artifact artifact : view.directs()) {
+ if (artifact.isMiddlemanArtifact()) {
+ continue;
+ }
+ artifacts.add(artifact.getPath());
+ }
+ return artifacts.build();
+ }
+
+ @Override
public BuildEventStreamProtos.BuildEvent asStreamProto(BuildEventContext converters) {
PathConverter pathConverter = converters.pathConverter();
ArtifactGroupNamer namer = converters.artifactGroupNamer();
@@ -59,6 +73,7 @@ class NamedArtifactGroup implements BuildEvent {
BuildEventStreamProtos.NamedSetOfFiles.Builder builder =
BuildEventStreamProtos.NamedSetOfFiles.newBuilder();
for (Artifact artifact : view.directs()) {
+ // We never want to report middleman artifacts. They are for internal use only.
if (artifact.isMiddlemanArtifact()) {
continue;
}