diff options
author | 2017-04-21 17:09:40 +0200 | |
---|---|---|
committer | 2017-04-24 16:50:54 +0200 | |
commit | 0a6cd622c8aa4b4c96e95ad57de2bbe7bdc8f620 (patch) | |
tree | efbfae9d82cc28dde5422481098858991e8bbc05 /src/main/java | |
parent | 0c613be001098153b0ef639b54401730d6e03d45 (diff) |
BEP: Temporarily readd default outputs for targets
For the TargetComplete event (not for the completion of aspects) readd
the reporting of outputs, but only for the default output group. This
will help existing applications to still report the outputs of a target,
till they transferred to handling named sets of files.
Change-Id: I1b0730b38bdc18f8fb2ccf859a7fee8f1b7f0cac
PiperOrigin-RevId: 153828334
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/analysis/TargetCompleteEvent.java | 13 | ||||
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto | 5 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/TargetCompleteEvent.java b/src/main/java/com/google/devtools/build/lib/analysis/TargetCompleteEvent.java index 03c469191b..e0ba78af04 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/TargetCompleteEvent.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/TargetCompleteEvent.java @@ -24,6 +24,7 @@ import com.google.devtools.build.lib.buildeventstream.ArtifactGroupNamer; import com.google.devtools.build.lib.buildeventstream.BuildEventConverters; import com.google.devtools.build.lib.buildeventstream.BuildEventId; import com.google.devtools.build.lib.buildeventstream.BuildEventStreamProtos; +import com.google.devtools.build.lib.buildeventstream.BuildEventStreamProtos.File; import com.google.devtools.build.lib.buildeventstream.BuildEventStreamProtos.OutputGroup; import com.google.devtools.build.lib.buildeventstream.BuildEventWithOrderConstraint; import com.google.devtools.build.lib.buildeventstream.GenericBuildEvent; @@ -144,6 +145,18 @@ public final class TargetCompleteEvent builder.addAllTag(getTags()); builder.addAllOutputGroup(getOutputFilesByGroup(converters.artifactGroupNamer())); + // TODO(aehlig): remove direct reporting of artifacts as soon as clients no longer + // need it. + for (ArtifactsInOutputGroup group : outputs) { + if (group.areImportant()) { + for (Artifact artifact : group.getArtifacts()) { + String name = artifact.getFilename(); + String uri = converters.pathConverter().apply(artifact.getPath()); + builder.addImportantOutput(File.newBuilder().setName(name).setUri(uri).build()); + } + } + } + BuildEventStreamProtos.TargetComplete complete = builder.build(); return GenericBuildEvent.protoChaining(this).setCompleted(complete).build(); } diff --git a/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto b/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto index 73f9d17111..a59ef39cb3 100644 --- a/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto +++ b/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto @@ -296,6 +296,11 @@ message TargetComplete { // group. repeated OutputGroup output_group = 2; + // Temporarily, also report the important outputs directly. This is only to + // allow existing clients help transition to the deduplicated representation; + // new clients should not use it. + repeated File important_output = 4; + // List of tags associated with this target. repeated string tag = 3; } |