diff options
author | laszlocsomor <laszlocsomor@google.com> | 2017-07-17 13:09:48 +0200 |
---|---|---|
committer | Klaus Aehlig <aehlig@google.com> | 2017-07-17 13:41:43 +0200 |
commit | 5752463ece84ebb4fb074888cba57412ab8d86b3 (patch) | |
tree | c2c11cd91141f603045703b0054e0427165db066 /src/tools/android/java/com/google/devtools/build/android/Converters.java | |
parent | 8ed126b66fc3c06bfa597aa84a4d031b1669c02c (diff) |
AndroidBusyBox: deprecate path-list-type flags
This commit:
- deprecates PathListConverter
- removes ExistingPathListConverter because it was
not used in production, only tests
- deprecated List<Path> type flags that use
PathListConverter
- introduces new List<Path> type flags next to the
deprecated ones that use @Options.allowMultiple
and convert with PathConverter; the new and old
lists are concatenated, yielding the flag value
PathListConverter and all of its occurrences
should be removed after 2018-01-31 (about 6 months
from now, which is a safe enough timeframe for
everyone to upgrade Bazel so it uses the new-style
flags).
Reason for deprecation is that colon-separated
path lists don't work on Windows because paths
have colons in them.
Since the Android BusyBox is not intended to be
executed by users but by Bazel only, there's no
release notes necessary.
See https://github.com/bazelbuild/bazel/issues/3264
RELNOTES: none
PiperOrigin-RevId: 162193998
Diffstat (limited to 'src/tools/android/java/com/google/devtools/build/android/Converters.java')
-rw-r--r-- | src/tools/android/java/com/google/devtools/build/android/Converters.java | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/src/tools/android/java/com/google/devtools/build/android/Converters.java b/src/tools/android/java/com/google/devtools/build/android/Converters.java index 63f59801aa..9475449b7d 100644 --- a/src/tools/android/java/com/google/devtools/build/android/Converters.java +++ b/src/tools/android/java/com/google/devtools/build/android/Converters.java @@ -22,14 +22,11 @@ import com.google.common.collect.ImmutableMap; import com.google.devtools.common.options.Converter; import com.google.devtools.common.options.EnumConverter; import com.google.devtools.common.options.OptionsParsingException; -import java.io.File; import java.lang.reflect.ParameterizedType; import java.nio.file.FileSystems; import java.nio.file.Files; import java.nio.file.InvalidPathException; import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collections; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -286,49 +283,6 @@ public final class Converters { } } - /** - * Validating converter for a list of Paths. - * A Path is considered valid if it resolves to a file. - */ - public static class PathListConverter implements Converter<List<Path>> { - - private final PathConverter baseConverter; - - public PathListConverter() { - this(false); - } - - protected PathListConverter(boolean mustExist) { - baseConverter = new PathConverter(mustExist); - } - - @Override - public List<Path> convert(String input) throws OptionsParsingException { - List<Path> list = new ArrayList<>(); - for (String piece : input.split(File.pathSeparator)) { - if (!piece.isEmpty()) { - list.add(baseConverter.convert(piece)); - } - } - return Collections.unmodifiableList(list); - } - - @Override - public String getTypeDescription() { - return "a colon-separated list of paths"; - } - } - - /** - * Validating converter for a list of Paths. The list is considered valid if all Paths resolve to - * a file that exists. - */ - public static class ExistingPathListConverter extends PathListConverter { - public ExistingPathListConverter() { - super(true); - } - } - // Commas that are not escaped by a backslash. private static final String UNESCAPED_COMMA_REGEX = "(?<!\\\\)\\,"; // Colons that are not escaped by a backslash. |