summaryrefslogtreecommitdiff
path: root/ios/framework
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2015-12-03 16:03:00 -0800
committerMinh Nguyễn <mxn@1ec5.org>2016-01-22 14:45:56 -0800
commit9350d3f78cee508f98bbae8d31a3a47007cb0322 (patch)
tree43d9d71c670b4a900727dcd56b59b85860b66401 /ios/framework
parentded8b62c916b2ad1782486ed9d1fe5049a82c512 (diff)
downloadqtlocation-mapboxgl-9350d3f78cee508f98bbae8d31a3a47007cb0322.tar.gz
[ios] Converted iOS SDK into dynamic framework
make iproj now produces a target that pulls together static libraries like core and platform-ios into a real dynamic framework. iosapp is pretty much just a regular iOS application that links Mapbox.framework (except for the inclusion of default_styles.hpp). iosapp runs fine in the Simulator and on a device, and the same is true for any application linking against Mapbox.framework. The ipackage target produces both a Bitcode-disabled static framework and a Bitcode-enabled dynamic framework, eliminating the need for a separate framework.sh. It disables code signing, since that happens on copy when the framework is embedded inside the application bundle. It also merges the device and simulator builds into a single fat framework. Also bumped itest minimum deployment target to iOS 8.0, the first version that supports linking frameworks. Fixes #828.
Diffstat (limited to 'ios/framework')
-rw-r--r--ios/framework/Info.plist38
-rw-r--r--ios/framework/Mapbox.h26
-rw-r--r--ios/framework/Mapbox.m29
-rw-r--r--ios/framework/framework-ios.gypi70
-rw-r--r--ios/framework/umbrella9
5 files changed, 143 insertions, 29 deletions
diff --git a/ios/framework/Info.plist b/ios/framework/Info.plist
index 1dd4a72aef..7cb6e1dfd3 100644
--- a/ios/framework/Info.plist
+++ b/ios/framework/Info.plist
@@ -2,25 +2,23 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>en</string>
- <key>CFBundleExecutable</key>
- <string>${EXECUTABLE_NAME}</string>
- <key>CFBundleIdentifier</key>
- <string>com.mapbox.sdk.ios</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>${PRODUCT_NAME}</string>
- <key>CFBundlePackageType</key>
- <string>FMWK</string>
- <key>CFBundleShortVersionString</key>
- <string>#####</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>%%%%%</string>
- <key>NSPrincipalClass</key>
- <string></string>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleShortVersionString</key>
+ <string>0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0</string>
</dict>
</plist>
diff --git a/ios/framework/Mapbox.h b/ios/framework/Mapbox.h
new file mode 100644
index 0000000000..0df6d1f611
--- /dev/null
+++ b/ios/framework/Mapbox.h
@@ -0,0 +1,26 @@
+#import <Foundation/Foundation.h>
+
+/// Project version number for Mapbox.
+FOUNDATION_EXPORT double MapboxVersionNumber;
+
+/// Project version string for Mapbox.
+FOUNDATION_EXPORT const unsigned char MapboxVersionString[];
+
+#import <Mapbox/MGLAccountManager.h>
+#import <Mapbox/MGLAnnotation.h>
+#import <Mapbox/MGLAnnotationImage.h>
+#import <Mapbox/MGLCalloutView.h>
+#import <Mapbox/MGLMapCamera.h>
+#import <Mapbox/MGLGeometry.h>
+#import <Mapbox/MGLMapView.h>
+#import <Mapbox/MGLMapView+IBAdditions.h>
+#import <Mapbox/MGLMapView+MGLCustomStyleLayerAdditions.h>
+#import <Mapbox/MGLMultiPoint.h>
+#import <Mapbox/MGLOverlay.h>
+#import <Mapbox/MGLPointAnnotation.h>
+#import <Mapbox/MGLPolygon.h>
+#import <Mapbox/MGLPolyline.h>
+#import <Mapbox/MGLShape.h>
+#import <Mapbox/MGLStyle.h>
+#import <Mapbox/MGLTypes.h>
+#import <Mapbox/MGLUserLocation.h>
diff --git a/ios/framework/Mapbox.m b/ios/framework/Mapbox.m
new file mode 100644
index 0000000000..a81ca09135
--- /dev/null
+++ b/ios/framework/Mapbox.m
@@ -0,0 +1,29 @@
+#import <Mapbox/Mapbox.h>
+
+#import "../../platform/ios/src/NSBundle+MGLAdditions.h"
+#import "../../platform/ios/src/NSProcessInfo+MGLAdditions.h"
+#import "../../platform/darwin/NSString+MGLAdditions.h"
+
+__attribute__((constructor))
+static void InitializeMapbox() {
+ static int initialized = 0;
+ if (initialized) {
+ return;
+ }
+
+ mgl_linkBundleCategory();
+ mgl_linkStringCategory();
+ mgl_linkProcessInfoCategory();
+
+ [MGLAccountManager class];
+ [MGLAnnotationImage class];
+ [MGLMapCamera class];
+ [MGLMapView class];
+ [MGLMultiPoint class];
+ [MGLPointAnnotation class];
+ [MGLPolygon class];
+ [MGLPolyline class];
+ [MGLShape class];
+ [MGLStyle class];
+ [MGLUserLocation class];
+}
diff --git a/ios/framework/framework-ios.gypi b/ios/framework/framework-ios.gypi
new file mode 100644
index 0000000000..8c83523e58
--- /dev/null
+++ b/ios/framework/framework-ios.gypi
@@ -0,0 +1,70 @@
+{
+ 'includes': [
+ '../../gyp/common.gypi',
+ ],
+ 'targets': [
+ {
+ 'target_name': 'iossdk',
+ 'product_name': 'Mapbox',
+ 'type': 'shared_library',
+ 'mac_bundle': 1,
+
+ 'dependencies': [
+ 'mbgl.gyp:core',
+ 'mbgl.gyp:platform-<(platform_lib)',
+ 'mbgl.gyp:http-<(http_lib)',
+ 'mbgl.gyp:asset-<(asset_lib)',
+ ],
+
+ 'xcode_settings': {
+ 'CLANG_ENABLE_OBJC_ARC': 'YES',
+ 'COMBINE_HIDPI_IMAGES': 'NO', # disable combining @2x, @3x images into .tiff files
+ 'CURRENT_PROJECT_VERSION': '0',
+ 'DEFINES_MODULE': 'YES',
+ 'DYLIB_INSTALL_NAME_BASE': '@rpath',
+ 'INFOPLIST_FILE': '../ios/framework/Info.plist',
+ 'LD_RUNPATH_SEARCH_PATHS': [
+ '$(inherited)',
+ '@executable_path/Frameworks',
+ '@loader_path/Frameworks',
+ ],
+ 'PRODUCT_BUNDLE_IDENTIFIER': 'com.mapbox.sdk.ios',
+ 'OTHER_LDFLAGS': [ '-stdlib=libc++', '-lstdc++' ],
+ 'SDKROOT': 'iphoneos',
+ 'SKIP_INSTALL': 'YES',
+ 'SUPPORTED_PLATFORMS': [
+ 'iphonesimulator',
+ 'iphoneos',
+ ],
+ 'VERSIONING_SYSTEM': 'apple-generic',
+ },
+
+ 'mac_framework_headers': [
+ 'Mapbox.h',
+ '<!@(find ../include/mbgl/{darwin,ios} -type f \! -name \'.*\' \! -name Mapbox.h)',
+ ],
+
+ 'sources': [
+ 'Mapbox.m',
+ ],
+
+ 'configurations': {
+ 'Debug': {
+ 'xcode_settings': {
+ 'CODE_SIGN_IDENTITY': 'iPhone Developer',
+ 'DEAD_CODE_STRIPPING': 'YES',
+ 'GCC_OPTIMIZATION_LEVEL': '0',
+ },
+ },
+ 'Release': {
+ 'xcode_settings': {
+ 'ARCHS': [ "armv7", "armv7s", "arm64", "i386", "x86_64" ],
+ 'CODE_SIGN_IDENTITY': 'iPhone Distribution',
+ 'DEAD_CODE_STRIPPING': 'YES',
+ 'GCC_OPTIMIZATION_LEVEL': 's',
+ },
+ },
+ },
+ },
+ ]
+}
diff --git a/ios/framework/umbrella b/ios/framework/umbrella
deleted file mode 100644
index 9c04d5c752..0000000000
--- a/ios/framework/umbrella
+++ /dev/null
@@ -1,9 +0,0 @@
-
-#import <GLKit/GLKit.h>
-#import <ImageIO/ImageIO.h>
-#import <MobileCoreServices/MobileCoreServices.h>
-#import <QuartzCore/QuartzCore.h>
-#import <SystemConfiguration/SystemConfiguration.h>
-
-FOUNDATION_EXPORT double MapboxVersionNumber;
-FOUNDATION_EXPORT const unsigned char MapboxVersionString[];