diff options
author | tomlu <tomlu@google.com> | 2017-08-21 19:26:41 +0200 |
---|---|---|
committer | Damien Martin-Guillerez <dmarting@google.com> | 2017-08-22 09:13:28 +0200 |
commit | c03ca7cc8bcef66f8e077c2451e8a9f68ee4733c (patch) | |
tree | 58900eec150ce36e0bbc024bf1f436ff65abf785 /src/main/java/com/google/devtools/build/lib/rules/objc/BundleSupport.java | |
parent | d795133a34fd2a61177be3febb9c61c83b10f3c2 (diff) |
Improve CustomCommandLine interface.
In converting SpawnAction.Builder (multi-thousand line CL) users directly to CustomCommandLine I didn't like the resulting loss of readability, and the methods didn't feel very discoverable. Unless it's very convenient and readable to use CustomCommandLine, people will resort to non-memory efficient patterns by default. I'm holding that CL for this, which should offer a nicer interface.
This CL removes VectorArg from the API contact surface area, instead creating 64 overloads for every valid combination of parameters. Pretty sad, but the methods dispatch straight to internal helper methods so it's mostly boilerplate to the tune of +400 LOC.
Other changes:
* Change ImmutableCollection -> Collection and copy the args directly into the internal args vector. Saves on collection object overhead and saves users from having to create immutable copies.
* Change some names, notably add -> addAll for collection methods
* Create additional missing overloads
* Fix JavaDoc
RELNOTES: None
PiperOrigin-RevId: 165943879
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/objc/BundleSupport.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/objc/BundleSupport.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/BundleSupport.java b/src/main/java/com/google/devtools/build/lib/rules/objc/BundleSupport.java index 805f90f68f..b96f37d418 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/BundleSupport.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/BundleSupport.java @@ -447,8 +447,8 @@ final class BundleSupport { } return commandLine - .add(ImmutableList.copyOf(PathFragment.safePathStrings(provider.get(XCASSETS_DIR)))) - .add(ImmutableList.copyOf(extraActoolArgs)) + .addAll(ImmutableList.copyOf(PathFragment.safePathStrings(provider.get(XCASSETS_DIR)))) + .addAll(ImmutableList.copyOf(extraActoolArgs)) .build(); } |