diff options
author | laszlocsomor <laszlocsomor@google.com> | 2017-08-04 12:56:42 +0200 |
---|---|---|
committer | Dmitry Lomov <dslomov@google.com> | 2017-08-04 17:19:09 +0200 |
commit | 025a7b0a33680c53d872d241fdb49f3ab578afd6 (patch) | |
tree | cfcca497c74f25361537a038a4c898b26a7af39e /src/main/java/com/google/devtools/build/lib/rules/android/RClassGeneratorActionBuilder.java | |
parent | 8879b48fa1f8f5bdc39321e31b02323b9f9dd86a (diff) |
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
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/android/RClassGeneratorActionBuilder.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/android/RClassGeneratorActionBuilder.java | 8 |
1 files changed, 4 insertions, 4 deletions
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<ResourceContainer> 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() : ""); } }; |