aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2018-07-19 07:34:36 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-07-19 07:36:08 -0700
commit866fda697b21a6aa129cd7513ec7638bc2ddd43d (patch)
tree6a55fbf8f88c7e211594fd0661bb569780c0e220 /src/main
parent04d8ea8fec3c8e7792923e29062f5e866bf45376 (diff)
Remove workspace status language filter, and C++ linkstamp "VERBATIM" output type.
RELNOTES: None. PiperOrigin-RevId: 205237848
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/WorkspaceStatusAction.java28
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/WriteBuildInfoHeaderAction.java5
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/java/WriteBuildInfoPropertiesAction.java4
3 files changed, 3 insertions, 34 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/WorkspaceStatusAction.java b/src/main/java/com/google/devtools/build/lib/analysis/WorkspaceStatusAction.java
index 2baced77ff..6886a6ad83 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/WorkspaceStatusAction.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/WorkspaceStatusAction.java
@@ -84,18 +84,9 @@ public abstract class WorkspaceStatusAction extends AbstractAction {
public enum KeyType {
INTEGER,
STRING,
- VERBATIM,
}
/**
- * Language for keys that should be present in the build info for every language.
- */
- // TODO(bazel-team): Once this is released, migrate the only place in the depot to use
- // the BUILD_USERNAME, BUILD_HOSTNAME and BUILD_DIRECTORY keys instead of BUILD_INFO. Then
- // language-specific build info keys can be removed.
- public static final String ALL_LANGUAGES = "*";
-
- /**
* Action context required by the actions that write language-specific workspace status artifacts.
*/
public static interface Context extends ActionContext {
@@ -109,17 +100,11 @@ public abstract class WorkspaceStatusAction extends AbstractAction {
public static class Key {
private final KeyType type;
- /**
- * Should be set to ALL_LANGUAGES if the key should be present in the build info of every
- * language.
- */
- private final String language;
private final String defaultValue;
private final String redactedValue;
- private Key(KeyType type, String language, String defaultValue, String redactedValue) {
+ private Key(KeyType type, String defaultValue, String redactedValue) {
this.type = type;
- this.language = language;
this.defaultValue = defaultValue;
this.redactedValue = redactedValue;
}
@@ -128,10 +113,6 @@ public abstract class WorkspaceStatusAction extends AbstractAction {
return type;
}
- public boolean isInLanguage(String language) {
- return this.language.equals(ALL_LANGUAGES) || this.language.equals(language);
- }
-
public String getDefaultValue() {
return defaultValue;
}
@@ -140,13 +121,8 @@ public abstract class WorkspaceStatusAction extends AbstractAction {
return redactedValue;
}
- public static Key forLanguage(
- String language, KeyType type, String defaultValue, String redactedValue) {
- return new Key(type, language, defaultValue, redactedValue);
- }
-
public static Key of(KeyType type, String defaultValue, String redactedValue) {
- return new Key(type, ALL_LANGUAGES, defaultValue, redactedValue);
+ return new Key(type, defaultValue, redactedValue);
}
}
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/WriteBuildInfoHeaderAction.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/WriteBuildInfoHeaderAction.java
index 5d977a1dff..12739b671d 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/WriteBuildInfoHeaderAction.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/WriteBuildInfoHeaderAction.java
@@ -109,16 +109,11 @@ public final class WriteBuildInfoHeaderAction extends AbstractFileWriteAction {
Writer writer = new OutputStreamWriter(out, UTF_8);
for (Map.Entry<String, WorkspaceStatusAction.Key> key : keys.entrySet()) {
- if (!key.getValue().isInLanguage("C++")) {
- continue;
- }
-
String value = redacted ? key.getValue().getRedactedValue()
: values.containsKey(key.getKey()) ? values.get(key.getKey())
: key.getValue().getDefaultValue();
switch (key.getValue().getType()) {
- case VERBATIM:
case INTEGER:
break;
diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/WriteBuildInfoPropertiesAction.java b/src/main/java/com/google/devtools/build/lib/rules/java/WriteBuildInfoPropertiesAction.java
index 26c4cd1b84..f234819211 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/java/WriteBuildInfoPropertiesAction.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/java/WriteBuildInfoPropertiesAction.java
@@ -177,9 +177,7 @@ public class WriteBuildInfoPropertiesAction extends AbstractFileWriteAction {
Map<String, Key> keys) {
boolean redacted = values.isEmpty();
for (Map.Entry<String, WorkspaceStatusAction.Key> key : keys.entrySet()) {
- if (key.getValue().isInLanguage("Java")) {
- result.put(key.getKey(), gePropertyValue(values, redacted, key));
- }
+ result.put(key.getKey(), gePropertyValue(values, redacted, key));
}
}