aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/objc/IosExtension.java
diff options
context:
space:
mode:
authorGravatar Dmitry Shevchenko <dmishe@google.com>2015-08-11 18:19:18 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2015-08-12 15:22:22 +0000
commit6c630794b9a3eea04a2b9de0c00edfec920eff66 (patch)
tree3c0df31848ad8a91facf1bb1c6adbf526eb88f38 /src/main/java/com/google/devtools/build/lib/rules/objc/IosExtension.java
parentee5e5e17d1ab9b1f2bb10115b23ff1a70fccd014 (diff)
Experimental support for ios_framework rules
* Allows for building and linking to a framework in ios_application * Currently only works for single arch builds * Xcode generation produces correct target type, but is mostly untested The implementation is very similar to that of objc_framework: 1) Build the ios_framework_binary as a dynamic library (-dynamiclib) 2) Symlink the library and public headers to a staging location, inside of "X.framework" bundle. Where X is the name under ios_framework_binary#framework_name 3) Pass the bundle content to ObjcCommon.addFrameworkImports, reusing the core of objc_framework rule implementation. This results in correctly set -F/-framework flags and allows clients to use the framework in a way they would use any SDK/3rd-party framework. It's allowed to import headers via #import <X/X.h> call. 4) Copy the binary and all resources into final application bundle under Frameworks/X.framework 5) Sign the app and nested frameworks -- MOS_MIGRATED_REVID=100397239
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/objc/IosExtension.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/IosExtension.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/IosExtension.java b/src/main/java/com/google/devtools/build/lib/rules/objc/IosExtension.java
index f16327d3c2..821fa5e8e1 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/IosExtension.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/IosExtension.java
@@ -14,6 +14,8 @@
package com.google.devtools.build.lib.rules.objc;
+import static com.google.devtools.build.lib.rules.objc.ObjcProvider.MERGE_ZIP;
+
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
@@ -48,8 +50,7 @@ public class IosExtension extends ReleaseBundlingTargetFactory {
public IosExtension() {
super(ReleaseBundlingSupport.EXTENSION_BUNDLE_DIR_FORMAT, XcodeProductType.EXTENSION,
- ExposeAsNestedBundle.YES, ImmutableSet.of(new Attribute("binary", Mode.SPLIT)),
- ConfigurationDistinguisher.EXTENSION);
+ ImmutableSet.of(new Attribute("binary", Mode.SPLIT)), ConfigurationDistinguisher.EXTENSION);
}
@Override
@@ -57,6 +58,14 @@ public class IosExtension extends ReleaseBundlingTargetFactory {
return determineMinimumOsVersion(ObjcRuleClasses.objcConfiguration(ruleContext).getMinimumOs());
}
+ @Override
+ protected ObjcProvider exposedObjcProvider(RuleContext ruleContext) {
+ // Nest this target's bundle under final IPA
+ return new ObjcProvider.Builder()
+ .add(MERGE_ZIP, ruleContext.getImplicitOutputArtifact(ReleaseBundlingSupport.IPA))
+ .build();
+ }
+
private static String determineMinimumOsVersion(String fromFlag) {
if (Double.parseDouble(fromFlag) < Double.parseDouble(EXTENSION_MINIMUM_OS_VERSION)) {
// Extensions are not accepted by Apple below version 8.0. While applications built with a