aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/TargetConfiguredEvent.java7
-rw-r--r--src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto6
2 files changed, 12 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/TargetConfiguredEvent.java b/src/main/java/com/google/devtools/build/lib/analysis/TargetConfiguredEvent.java
index 8395337a4c..db6bea2563 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/TargetConfiguredEvent.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/TargetConfiguredEvent.java
@@ -22,9 +22,12 @@ import com.google.devtools.build.lib.buildeventstream.BuildEventStreamProtos;
import com.google.devtools.build.lib.buildeventstream.BuildEventWithConfiguration;
import com.google.devtools.build.lib.buildeventstream.GenericBuildEvent;
import com.google.devtools.build.lib.buildeventstream.NullConfiguration;
+import com.google.devtools.build.lib.packages.RawAttributeMapper;
+import com.google.devtools.build.lib.packages.Rule;
import com.google.devtools.build.lib.packages.Target;
import com.google.devtools.build.lib.packages.TargetUtils;
import com.google.devtools.build.lib.packages.TestSize;
+import com.google.devtools.build.lib.syntax.Type;
import java.util.Collection;
/** Event reporting about the configurations associated with a given target */
@@ -88,6 +91,10 @@ public class TargetConfiguredEvent implements BuildEventWithConfiguration {
public BuildEventStreamProtos.BuildEvent asStreamProto(BuildEventConverters converters) {
BuildEventStreamProtos.TargetConfigured.Builder builder =
BuildEventStreamProtos.TargetConfigured.newBuilder().setTargetKind(target.getTargetKind());
+ Rule rule = target.getAssociatedRule();
+ if (rule != null) {
+ builder.addAllTag(RawAttributeMapper.of(rule).getMergedValues("tags", Type.STRING_LIST));
+ }
if (TargetUtils.isTestRule(target)) {
builder.setTestSize(bepTestSize(TestSize.getTestSize(target.getAssociatedRule())));
}
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 c80349868c..1d6b907b56 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
@@ -324,6 +324,10 @@ message TargetConfigured {
// The size of the test, if the target is a test target. Unset otherwise.
TestSize test_size = 2;
+
+ // List of all tags associated with this target (for all possible
+ // configurations).
+ repeated string tag = 3;
}
message File {
@@ -414,7 +418,7 @@ message TargetComplete {
// new clients should not use it.
repeated File important_output = 4 [deprecated = true];
- // List of tags associated with this target.
+ // List of tags associated with this configured target.
repeated string tag = 3;
}