aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/buildeventstream
diff options
context:
space:
mode:
authorGravatar Klaus Aehlig <aehlig@google.com>2017-03-15 12:39:06 +0000
committerGravatar Yun Peng <pcloudy@google.com>2017-03-16 08:34:22 +0000
commit42f3f46e38433ff27a98510bd5c7dc56b5cf7b73 (patch)
tree95db8e4046e8246fd501d11e1571fee150ff211d /src/main/java/com/google/devtools/build/lib/buildeventstream
parent0d77ed6f90118cc97cdf97ff0fe969902fad14c6 (diff)
Make AspectCompleteEvent an instance of BuildEvent
In this way, we can also report the artifacts generated by aspects in the build event protocol. For the time being, those events are reported unsolicitly (i.e., as children of progress events), but they may be linked to pattern expansion later. -- Change-Id: I7fb83088d7fdb5424f77bfb78700e8371231b13c Reviewed-on: https://cr.bazel.build/9370 PiperOrigin-RevId: 150181433 MOS_MIGRATED_REVID=150181433
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/buildeventstream')
-rw-r--r--src/main/java/com/google/devtools/build/lib/buildeventstream/BuildEventId.java10
-rw-r--r--src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto4
2 files changed, 14 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/buildeventstream/BuildEventId.java b/src/main/java/com/google/devtools/build/lib/buildeventstream/BuildEventId.java
index 3a89fa5aeb..81f9eac0aa 100644
--- a/src/main/java/com/google/devtools/build/lib/buildeventstream/BuildEventId.java
+++ b/src/main/java/com/google/devtools/build/lib/buildeventstream/BuildEventId.java
@@ -117,6 +117,16 @@ public final class BuildEventId implements Serializable {
BuildEventStreamProtos.BuildEventId.newBuilder().setTargetCompleted(targetId).build());
}
+ public static BuildEventId aspectCompleted(Label target, String aspect) {
+ BuildEventStreamProtos.BuildEventId.TargetCompletedId targetId =
+ BuildEventStreamProtos.BuildEventId.TargetCompletedId.newBuilder()
+ .setLabel(target.toString())
+ .setAspect(aspect)
+ .build();
+ return new BuildEventId(
+ BuildEventStreamProtos.BuildEventId.newBuilder().setTargetCompleted(targetId).build());
+ }
+
public static BuildEventId fromCause(Cause cause) {
return new BuildEventId(cause.getIdProto());
}
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 072a7ef9ca..a4592faac1 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
@@ -63,6 +63,10 @@ message BuildEventId {
// does not include running the test if the target is a test target.
message TargetCompletedId {
string label = 1;
+
+ // If not empty, the id refers to the completion of the target for a given
+ // aspect.
+ string aspect = 2;
}
// Identifier of an event reporting that an action was completed (not all