diff options
author | 2015-08-11 18:19:18 +0000 | |
---|---|---|
committer | 2015-08-12 15:22:22 +0000 | |
commit | 6c630794b9a3eea04a2b9de0c00edfec920eff66 (patch) | |
tree | 3c0df31848ad8a91facf1bb1c6adbf526eb88f38 /src/objc_tools | |
parent | ee5e5e17d1ab9b1f2bb10115b23ff1a70fccd014 (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/objc_tools')
-rw-r--r-- | src/objc_tools/xcodegen/java/com/google/devtools/build/xcode/xcodegen/XcodeprojGeneration.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/objc_tools/xcodegen/java/com/google/devtools/build/xcode/xcodegen/XcodeprojGeneration.java b/src/objc_tools/xcodegen/java/com/google/devtools/build/xcode/xcodegen/XcodeprojGeneration.java index 496d50df56..9108913522 100644 --- a/src/objc_tools/xcodegen/java/com/google/devtools/build/xcode/xcodegen/XcodeprojGeneration.java +++ b/src/objc_tools/xcodegen/java/com/google/devtools/build/xcode/xcodegen/XcodeprojGeneration.java @@ -84,6 +84,7 @@ public class XcodeprojGeneration { public static final String FILE_TYPE_WRAPPER_APPLICATION = "wrapper.application"; public static final String FILE_TYPE_WRAPPER_BUNDLE = "wrapper.cfbundle"; public static final String FILE_TYPE_APP_EXTENSION = "wrapper.app-extension"; + public static final String FILE_TYPE_FRAMEWORK = "wrapper.frawework"; private static final String DEFAULT_OPTIONS_NAME = "Debug"; private static final Escaper QUOTE_ESCAPER = Escapers.builder().addEscape('"', "\\\"").build(); @@ -128,13 +129,15 @@ public class XcodeprojGeneration { ProductType.APPLICATION, ProductType.BUNDLE, ProductType.UNIT_TEST, - ProductType.APP_EXTENSION); + ProductType.APP_EXTENSION, + ProductType.FRAMEWORK); private static final EnumSet<ProductType> PRODUCT_TYPES_THAT_HAVE_A_BINARY = EnumSet.of( ProductType.APPLICATION, ProductType.BUNDLE, ProductType.UNIT_TEST, - ProductType.APP_EXTENSION); + ProductType.APP_EXTENSION, + ProductType.FRAMEWORK); /** * Detects the product type of the given target based on multiple fields in {@code targetControl}. @@ -201,6 +204,11 @@ public class XcodeprojGeneration { return FileReference.of( String.format("%s.appex", productName), SourceTree.BUILT_PRODUCTS_DIR) .withExplicitFileType(FILE_TYPE_APP_EXTENSION); + case FRAMEWORK: + return FileReference.of( + String.format("%s.framwork", productName), SourceTree.BUILT_PRODUCTS_DIR) + .withExplicitFileType(FILE_TYPE_FRAMEWORK); + default: throw new IllegalArgumentException("unknown: " + type); } |