aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/objc/XcodeProvider.java
diff options
context:
space:
mode:
authorGravatar Chris Parsons <cparsons@google.com>2016-08-02 18:48:43 +0000
committerGravatar Yun Peng <pcloudy@google.com>2016-08-03 07:57:44 +0000
commit36ff24cca3e3e1bd09422bef646d98621b1270e4 (patch)
treedc1f9e5cb2354041b6027a1f5d602940957018e8 /src/main/java/com/google/devtools/build/lib/rules/objc/XcodeProvider.java
parentc55fe15fc36ad01b93f4efe85ff85911d041d5d7 (diff)
Introduce apple_watch2_extension rule for bundling watchOS2 extensions.
This can be used in conjunction with apple_binary to add watchOS2 extensions to an ios application bundle. This is the majority of the native work for this bundling logic. Before announcing general availability of this feature, we will want to: 1. Iterate with teams who have existing watchOS2 apps to catch any corner-case bugs 2. Introduce a skylark macro to wrap apple_watch2_extension and apple_binary into a single rule; this will both serve as a convenience and ensure users set the appropriate linkopts and platformtype on their apple_binary target. -- MOS_MIGRATED_REVID=129122855
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/objc/XcodeProvider.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/XcodeProvider.java19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/XcodeProvider.java b/src/main/java/com/google/devtools/build/lib/rules/objc/XcodeProvider.java
index 38e39348a6..36cd017fd1 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/XcodeProvider.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/XcodeProvider.java
@@ -53,7 +53,6 @@ import com.google.devtools.build.lib.vfs.PathFragment;
import com.google.devtools.build.xcode.xcodegen.proto.XcodeGenProtos.DependencyControl;
import com.google.devtools.build.xcode.xcodegen.proto.XcodeGenProtos.TargetControl;
import com.google.devtools.build.xcode.xcodegen.proto.XcodeGenProtos.XcodeprojBuildSetting;
-
import java.util.Arrays;
import java.util.EnumSet;
import java.util.HashMap;
@@ -508,10 +507,15 @@ public final class XcodeProvider implements TransitiveInfoProvider {
}
@VisibleForTesting
- static final EnumSet<XcodeProductType> CAN_LINK_PRODUCT_TYPES = EnumSet.of(
- XcodeProductType.APPLICATION, XcodeProductType.BUNDLE, XcodeProductType.UNIT_TEST,
- XcodeProductType.EXTENSION, XcodeProductType.FRAMEWORK, XcodeProductType.WATCH_OS1_EXTENSION,
- XcodeProductType.WATCH_OS1_APPLICATION);
+ static final EnumSet<XcodeProductType> CAN_LINK_PRODUCT_TYPES =
+ EnumSet.of(
+ XcodeProductType.APPLICATION,
+ XcodeProductType.BUNDLE,
+ XcodeProductType.UNIT_TEST,
+ XcodeProductType.EXTENSION,
+ XcodeProductType.FRAMEWORK,
+ XcodeProductType.WATCH_OS1_EXTENSION,
+ XcodeProductType.WATCH_OS1_APPLICATION);
/**
* Returns the name of the Xcode target that corresponds to a build target with the given name.
@@ -637,8 +641,9 @@ public final class XcodeProvider implements TransitiveInfoProvider {
// but do have a dummy source file to make Xcode happy.
boolean hasSources = dependency.compilationArtifacts.isPresent()
&& dependency.compilationArtifacts.get().getArchive().isPresent();
- if (hasSources || (dependency.productType == XcodeProductType.BUNDLE
- || (dependency.productType == XcodeProductType.WATCH_OS1_APPLICATION))) {
+ if (hasSources
+ || (dependency.productType == XcodeProductType.BUNDLE
+ || (dependency.productType == XcodeProductType.WATCH_OS1_APPLICATION))) {
String dependencyXcodeTargetName = dependency.dependencyXcodeTargetName();
Set<DependencyControl> set = jreTargetNames.contains(dependencyXcodeTargetName)
? jreDependencySet : dependencySet;