aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Miguel Alcon Pinto <malcon@google.com>2015-09-08 19:40:02 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2015-09-08 22:27:47 +0000
commitea2f63c98f4334c7dfe81fc9a0a20fcf4732ed59 (patch)
tree62ee3476b12f2827a97373405e684a9990f9a75a /src
parent475a1344e16337d053dbb5d8a48379cd87bea042 (diff)
Add an attribute to proto and xml query outputs to mark packages that are in error.
-- MOS_MIGRATED_REVID=102582717
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/google/devtools/build/lib/query2/output/ProtoOutputFormatter.java2
-rw-r--r--src/main/java/com/google/devtools/build/lib/query2/output/XmlOutputFormatter.java2
-rw-r--r--src/main/protobuf/build.proto6
3 files changed, 9 insertions, 1 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 1fb878212b..639e124eba 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
@@ -221,6 +221,8 @@ public class ProtoOutputFormatter extends OutputFormatter implements UnorderedFo
for (String feature : inputFile.getPackage().getFeatures()) {
input.addFeature(feature);
}
+
+ input.setPackageContainsErrors(inputFile.getPackage().containsErrors());
}
for (Label visibilityDependency : target.getVisibility().getDependencyLabels()) {
diff --git a/src/main/java/com/google/devtools/build/lib/query2/output/XmlOutputFormatter.java b/src/main/java/com/google/devtools/build/lib/query2/output/XmlOutputFormatter.java
index 50ae1fe28b..60e085e51c 100644
--- a/src/main/java/com/google/devtools/build/lib/query2/output/XmlOutputFormatter.java
+++ b/src/main/java/com/google/devtools/build/lib/query2/output/XmlOutputFormatter.java
@@ -178,6 +178,8 @@ class XmlOutputFormatter extends AbstractUnorderedFormatter {
addSubincludedFilesToElement(doc, elem, inputFile);
addSkylarkFilesToElement(doc, elem, inputFile);
addFeaturesToElement(doc, elem, inputFile);
+ elem.setAttribute("package_contains_errors",
+ String.valueOf(inputFile.getPackage().containsErrors()));
}
addPackageGroupsToElement(doc, elem, inputFile);
diff --git a/src/main/protobuf/build.proto b/src/main/protobuf/build.proto
index 9fb59b5c6d..72006cebd9 100644
--- a/src/main/protobuf/build.proto
+++ b/src/main/protobuf/build.proto
@@ -283,7 +283,7 @@ message EnvironmentGroup {
}
// A file that is an input into the build system.
-// Next-Id: 8
+// Next-Id: 10
message SourceFile {
// The name of the source file (a label).
required string name = 1;
@@ -316,6 +316,10 @@ message SourceFile {
// License attribute for the file.
optional License license = 8;
+
+ // True if the package contains an error. Only present if the SourceFile
+ // represents a BUILD file.
+ optional bool package_contains_errors = 9;
}
// A file that is the output of a build rule.