aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java
diff options
context:
space:
mode:
authorGravatar Erik Abair <abaire@google.com>2016-09-12 18:52:49 +0000
committerGravatar Dmitry Lomov <dslomov@google.com>2016-09-13 12:25:14 +0000
commitb137868e5d8fb6cd16025fd0999424e88939aa65 (patch)
treeecb68dc5b0d997befc921f4f26c0f967c368812b /src/main/java
parent7f77b45284080de49b3c74a6abebe1a6ff47ee71 (diff)
Fixes actool invocation for watchOS2 targets.
Sets --platform argument on actool invocation correctly for watchOS targets. Previously the platform was hardcoded to iOS. -- MOS_MIGRATED_REVID=132899993
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/BundleSupport.java8
1 files changed, 7 insertions, 1 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 66650a2d7c..ebfe6cab1c 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
@@ -441,12 +441,18 @@ final class BundleSupport {
private CommandLine actoolzipCommandLine(ObjcProvider provider, Artifact zipOutput,
Artifact partialInfoPlist) {
AppleConfiguration appleConfiguration = ruleContext.getFragment(AppleConfiguration.class);
+ PlatformType platformType = PlatformType.IOS;
+ // watchOS 1 and 2 use different platform arguments. It is likely that versions 2 and later will
+ // use the watchos platform whereas watchOS 1 uses the iphone platform.
+ if (isBuildingForWatch() && bundling.getBundleDir().startsWith("Watch")) {
+ platformType = PlatformType.WATCHOS;
+ }
CustomCommandLine.Builder commandLine =
CustomCommandLine.builder()
// The next three arguments are positional, i.e. they don't have flags before them.
.addPath(zipOutput.getExecPath())
.add("--platform")
- .add(appleConfiguration.getMultiArchPlatform(PlatformType.IOS)
+ .add(appleConfiguration.getMultiArchPlatform(platformType)
.getLowerCaseNameInPlist())
.addExecPath("--output-partial-info-plist", partialInfoPlist)
.add("--minimum-deployment-target")