Improve preparation for flag changes which will come out with an upcoming AAPT2 version.
@@ -47,16 +47,24 @@ class Aapt2OptimizeAction {
ImmutableList<String> rawOptimizeArgs =
optionsParser.getResidue().stream()
+ // TODO(b/141204955): Remove these mapping hacks once some dust has settled.
.map(
arg -> {
- // Translate new (i.e. soon to be renamed) flag into current flag, pending an
- // upcoming aapt2 update.
- // TODO(bcsf): Prior to the aapt2 drop which introduces the renamed flag, add a
- // check to determine whether this mapping needs to be performed.
switch (arg) {
+ case "--shorten-resource-paths":
+ case "--enable-resource-path-shortening":
+ /* TODO(bcsf): Start using this at the time we drop AAPT2 5880457.
+ return "--shorten-resource-paths";
+ */
+ return "--enable-resource-path-shortening";
+ case "--collapse-resource-names":
case "--enable-resource-name-obfuscation":
+ /* TODO(bcsf): Start using this at the time we drop AAPT2 5880457.
+ return "--collapse-resource-names";
+ */
return "--enable-resource-obfuscation";
case "--resource-name-obfuscation-exemption-list":
+ // TODO(bcsf): This case goes away soon.
return "--whitelist-path";
default:
return arg;
