From 025a7b0a33680c53d872d241fdb49f3ab578afd6 Mon Sep 17 00:00:00 2001 From: laszlocsomor Date: Fri, 4 Aug 2017 12:56:42 +0200 Subject: Android BusyBox: deprecate --libraries flag Deprecate the --libraries flag of the GENERATE_BINARY_R tool in favour of --library. The new flag is multi-value and uses "," as the pair-separator instead of ":". The value converter still supports ":"-separated pairs as well, but looks for "," first. Old format: --libraries=key1:value1,key2:value2,... New format: --library=key1,value1 --library=key2,value2 Motivation: - the ":"-separator prevents using absolute paths on Windows The old flag is still supported, but will be removed after 2018-02-28 (about 6 months from now). Also in this commit: - add a new method to CustomCommandLine.Builder to lazily construct the command line for the --library flag See https://github.com/bazelbuild/bazel/issues/3264 RELNOTES: none PiperOrigin-RevId: 164246506 --- .../build/lib/rules/android/RClassGeneratorActionBuilder.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/rules/android/RClassGeneratorActionBuilder.java') diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/RClassGeneratorActionBuilder.java b/src/main/java/com/google/devtools/build/lib/rules/android/RClassGeneratorActionBuilder.java index 49ef64770c..0c40818e16 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/RClassGeneratorActionBuilder.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/RClassGeneratorActionBuilder.java @@ -100,9 +100,9 @@ public class RClassGeneratorActionBuilder { if (dependencies != null) { // TODO(corysmith): Remove NestedSet as we are already flattening it. Iterable depResources = dependencies.getResources(); - if (depResources.iterator().hasNext()) { - builder.addJoinStrings( - "--libraries", ",", Iterables.transform(depResources, chooseDepsToArg(version))); + if (!Iterables.isEmpty(depResources)) { + builder.addBeforeEach( + "--library", Iterables.transform(depResources, chooseDepsToArg(version))); inputs.addTransitive( NestedSetBuilder.wrap( Order.NAIVE_LINK_ORDER, @@ -159,7 +159,7 @@ public class RClassGeneratorActionBuilder { public String apply(ResourceContainer container) { Artifact rTxt = chooseRTxt(container, version); return (rTxt != null ? rTxt.getExecPath() : "") - + ":" + + "," + (container.getManifest() != null ? container.getManifest().getExecPath() : ""); } }; -- cgit v1.2.3