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/ResourceShrinkerAction.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/ResourceShrinkerAction.java')
-rw-r--r-- | src/tools/android/java/com/google/devtools/build/android/ResourceShrinkerAction.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/tools/android/java/com/google/devtools/build/android/ResourceShrinkerAction.java b/src/tools/android/java/com/google/devtools/build/android/ResourceShrinkerAction.java index 7abbb0c8b3..87854b4f7f 100644 --- a/src/tools/android/java/com/google/devtools/build/android/ResourceShrinkerAction.java +++ b/src/tools/android/java/com/google/devtools/build/android/ResourceShrinkerAction.java @@ -26,7 +26,6 @@ import com.google.devtools.build.android.AndroidResourceProcessor.AaptConfigOpti import com.google.devtools.build.android.AndroidResourceProcessor.FlagAaptOptions; import com.google.devtools.build.android.Converters.ExistingPathConverter; import com.google.devtools.build.android.Converters.PathConverter; -import com.google.devtools.build.android.Converters.PathListConverter; import com.google.devtools.build.android.Converters.VariantTypeConverter; import com.google.devtools.common.options.Converters.CommaSeparatedOptionListConverter; import com.google.devtools.common.options.Option; @@ -63,7 +62,7 @@ import org.xml.sax.SAXException; * --resources path to processed resources zip * --rTxt path to processed resources R.txt * --primaryManifest path to processed resources AndroidManifest.xml - * --dependencyManifests paths to dependency library manifests + * --dependencyManifest path to dependency library manifest (repeated flag) * --shrunkResourceApk path to write shrunk ap_ * --shrunkResources path to write shrunk resources zip * </pre> @@ -130,13 +129,14 @@ public class ResourceShrinkerAction { public Path primaryManifest; @Option( - name = "dependencyManifests", + name = "dependencyManifest", + allowMultiple = true, defaultValue = "", category = "input", - converter = PathListConverter.class, + converter = PathConverter.class, documentationCategory = OptionDocumentationCategory.UNCATEGORIZED, effectTags = {OptionEffectTag.UNKNOWN}, - help = "A list of paths to the manifests of the dependencies." + help = "Paths to the manifests of the dependencies. Specify one path per flag." ) public List<Path> dependencyManifests; @@ -236,6 +236,9 @@ public class ResourceShrinkerAction { optionsParser.parseAndExitUponError(args); aaptConfigOptions = optionsParser.getOptions(AaptConfigOptions.class); options = optionsParser.getOptions(Options.class); + if (options.dependencyManifests == null) { + options.dependencyManifests = ImmutableList.of(); + } AndroidResourceProcessor resourceProcessor = new AndroidResourceProcessor(stdLogger); // Setup temporary working directories. |