aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java b/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java
index 96a79209d8..9935a305b9 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java
@@ -148,9 +148,26 @@ public final class BuildConfiguration {
* The resulting set only contains labels that were derived from command-line options; the
* intention is that it can be used to sanity-check that the command-line options actually
* contain these in their transitive closure.
+ *
+ * <p>This functionality only exists for legacy configuration fragments that compute labels from
+ * command-line option values. Don't do that! Instead, use a rule that specifies the mapping
+ * explicitly.
*/
@SuppressWarnings("unused")
- public void addImplicitLabels(Multimap<String, Label> implicitLabels) {
+ protected void addImplicitLabels(Multimap<String, Label> implicitLabels) {
+ }
+
+ /**
+ * Returns a multimap of all labels that should be implicitly loaded from labels that were
+ * specified as options, keyed by the name to be displayed to the user if something goes wrong.
+ * The returned set only contains labels that were derived from command-line options; the
+ * intention is that it can be used to sanity-check that the command-line options actually
+ * contain these in their transitive closure.
+ */
+ public final ListMultimap<String, Label> getImplicitLabels() {
+ ListMultimap<String, Label> implicitLabels = ArrayListMultimap.create();
+ addImplicitLabels(implicitLabels);
+ return implicitLabels;
}
/**
@@ -1849,21 +1866,6 @@ public final class BuildConfiguration {
}
/**
- * Returns a multimap of all labels that should be implicitly loaded from labels that were
- * specified as options, keyed by the name to be displayed to the user if something goes wrong.
- * The returned set only contains labels that were derived from command-line options; the
- * intention is that it can be used to sanity-check that the command-line options actually contain
- * these in their transitive closure.
- */
- public ListMultimap<String, Label> getImplicitLabels() {
- ListMultimap<String, Label> implicitLabels = ArrayListMultimap.create();
- for (Fragment fragment : fragments.values()) {
- fragment.addImplicitLabels(implicitLabels);
- }
- return implicitLabels;
- }
-
- /**
* For an given environment, returns a subset containing all
* variables in the given list if they are defined in the given
* environment.