From e8d32b7c922f65539b74357711d5ad6b70934115 Mon Sep 17 00:00:00 2001 From: ulfjack Date: Fri, 3 Nov 2017 23:01:12 +0100 Subject: Switch ExtraActionFactory and GenRuleBase to the Expander API This changes the order in which expansions happen, which could change the semantics in subtle ways. PiperOrigin-RevId: 174518778 --- .../devtools/build/lib/analysis/CommandHelper.java | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/analysis/CommandHelper.java') diff --git a/src/main/java/com/google/devtools/build/lib/analysis/CommandHelper.java b/src/main/java/com/google/devtools/build/lib/analysis/CommandHelper.java index 74d05a7edf..6f1c16b3a6 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/CommandHelper.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/CommandHelper.java @@ -158,24 +158,11 @@ public final class CommandHelper { return values; } - /** - * Resolves a command, and expands known locations for $(location) variables. This method supports - * legacy heuristic label expansion, which replaces strings that look like labels with their - * corresponding file names. Use {@link #resolveCommandAndExpandLabels} instead. - */ - public String resolveCommandAndHeuristicallyExpandLabels( - String command, @Nullable String attribute, boolean enableLegacyHeuristicLabelExpansion) { - command = resolveCommandAndExpandLabels(command, attribute, false); - if (enableLegacyHeuristicLabelExpansion) { - command = expandLabels(command, labelMap); - } - return command; - } - /** * Resolves a command, and expands known locations for $(location) * variables. */ + @Deprecated // Only exists to support a legacy Skylark API. public String resolveCommandAndExpandLabels( String command, @Nullable String attribute, boolean allowDataInLabel) { LocationExpander expander; @@ -201,7 +188,7 @@ public final class CommandHelper { *

If the expansion fails, an attribute error is reported and the original * expression is returned. */ - private > String expandLabels(String expr, Map labelMap) { + public String expandLabelsHeuristically(String expr) { try { return LabelExpander.expand(expr, labelMap, ruleContext.getLabel()); } catch (LabelExpander.NotUniqueExpansionException nuee) { -- cgit v1.2.3