aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools
diff options
context:
space:
mode:
authorGravatar Michajlo Matijkiw <michajlo@google.com>2016-04-14 23:11:39 +0000
committerGravatar Lukacs Berki <lberki@google.com>2016-04-15 07:37:30 +0000
commit83d7f84aa5fc8ce118bafbbadfbd0434e6d54890 (patch)
tree7eef33efb757d182e8209d7f010246ead7444e22 /src/main/java/com/google/devtools
parentdf82ad922e5e4fb3eb7664339a288f421b3b6d96 (diff)
Allow ProtoOutputFormatter to filter aspect attributes
-- MOS_MIGRATED_REVID=119902657
Diffstat (limited to 'src/main/java/com/google/devtools')
-rw-r--r--src/main/java/com/google/devtools/build/lib/query2/output/ProtoOutputFormatter.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/query2/output/ProtoOutputFormatter.java b/src/main/java/com/google/devtools/build/lib/query2/output/ProtoOutputFormatter.java
index e8fa723003..023a0282bf 100644
--- a/src/main/java/com/google/devtools/build/lib/query2/output/ProtoOutputFormatter.java
+++ b/src/main/java/com/google/devtools/build/lib/query2/output/ProtoOutputFormatter.java
@@ -181,10 +181,10 @@ public class ProtoOutputFormatter extends AbstractUnorderedFormatter {
// Add information about additional attributes from aspects.
for (Entry<Attribute, Collection<Label>> entry : aspectsDependencies.asMap().entrySet()) {
Attribute attribute = entry.getKey();
- if (!includeAttribute(rule, attribute)) {
+ Collection<Label> labels = entry.getValue();
+ if (!includeAspectAttribute(attribute, labels)) {
continue;
}
- Collection<Label> labels = entry.getValue();
Object attributeValue = getAspectAttributeValue(attribute, labels);
Build.Attribute serializedAttribute =
AttributeSerializer.getAttributeProto(
@@ -345,6 +345,11 @@ public class ProtoOutputFormatter extends AbstractUnorderedFormatter {
return true;
}
+ /** Allow filtering of aspect attributes. */
+ protected boolean includeAspectAttribute(Attribute attr, Collection<Label> value) {
+ return true;
+ }
+
protected boolean includeRuleDefinitionEnvironment() {
return true;
}