Skip to content

Commit

Permalink
Simplify actoolzip argument flow
Browse files Browse the repository at this point in the history
--
MOS_MIGRATED_REVID=88789823
  • Loading branch information
illicitonion authored and kchodorow committed Mar 18, 2015
1 parent 7ad1e0e commit db16149
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package com.google.devtools.build.lib.rules.objc;

import com.google.common.base.Optional;
import com.google.common.collect.ImmutableList;
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.analysis.RuleConfiguredTarget.Mode;
import com.google.devtools.build.lib.analysis.RuleContext;
Expand Down Expand Up @@ -134,12 +133,8 @@ private void registerActoolActionIfNecessary(ObjcProvider objcProvider) {
new ObjcRuleClasses.Tools(ruleContext),
objcProvider,
actoolzipOutput.get(),
new ObjcActionsBuilder.ExtraActoolOutputs(actoolPartialInfoplist),
new ExtraActoolArgs(
new ImmutableList.Builder<String>()
.addAll(extraActoolArgs)
.add("--output-partial-info-plist", actoolPartialInfoplist.getExecPathString())
.build()),
actoolPartialInfoplist,
extraActoolArgs,
targetDeviceFamilies);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ void registerActoolzipAction(
ObjcRuleClasses.Tools tools,
ObjcProvider provider,
Artifact zipOutput,
ExtraActoolOutputs extraActoolOutputs,
Artifact partialInfoPlist,
ExtraActoolArgs extraActoolArgs,
Set<TargetDeviceFamily> families) {
// TODO(bazel-team): Do not use the deploy jar explicitly here. There is currently a bug where
Expand All @@ -367,11 +367,12 @@ void registerActoolzipAction(
.setMnemonic("AssetCatalogCompile")
.addTransitiveInputs(provider.get(ASSET_CATALOG))
.addOutput(zipOutput)
.addOutputs(extraActoolOutputs)
.addOutput(partialInfoPlist)
.setCommandLine(actoolzipCommandLine(
objcConfiguration,
provider,
zipOutput,
partialInfoPlist,
extraActoolArgs,
ImmutableSet.copyOf(families)))
.build(context));
Expand All @@ -381,6 +382,7 @@ private static CommandLine actoolzipCommandLine(
final ObjcConfiguration objcConfiguration,
final ObjcProvider provider,
final Artifact zipOutput,
final Artifact partialInfoPlist,
final ExtraActoolArgs extraActoolArgs,
final ImmutableSet<TargetDeviceFamily> families) {
return new CommandLine() {
Expand All @@ -393,6 +395,7 @@ public Iterable<String> arguments() {
.add(IosSdkCommands.ACTOOL_PATH)
.add("--platform")
.add(objcConfiguration.getPlatform().getLowerCaseNameInPlist())
.add("--output-partial-info-plist").add(partialInfoPlist.getExecPathString())
.add("--minimum-deployment-target").add(objcConfiguration.getMinimumOs());
for (TargetDeviceFamily targetDeviceFamily : families) {
args.add("--target-device").add(targetDeviceFamily.name().toLowerCase(Locale.US));
Expand Down

0 comments on commit db16149

Please sign in to comment.