summaryrefslogtreecommitdiff
path: root/platform/ios/framework
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-02-11 12:21:49 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-02-12 14:53:52 -0800
commit13e2acbc754893efb945fe02d20824698415dcdb (patch)
treee8e4c966f03798fc6896a0fd3163e83921f84a38 /platform/ios/framework
parentab677a7905b0f81850d6aa3dcdd2caebc0dbc851 (diff)
downloadqtlocation-mapboxgl-13e2acbc754893efb945fe02d20824698415dcdb.tar.gz
[ios, osx] Consolidate remaining files in platform/{ios,osx}
Diffstat (limited to 'platform/ios/framework')
-rw-r--r--platform/ios/framework/Info.plist24
-rw-r--r--platform/ios/framework/Mapbox.h26
-rw-r--r--platform/ios/framework/Mapbox.m29
-rw-r--r--platform/ios/framework/Settings.bundle/Root.plist33
-rw-r--r--platform/ios/framework/Settings.bundle/en.lproj/Root.stringsbin0 -> 552 bytes
-rw-r--r--platform/ios/framework/framework-ios.gypi70
-rw-r--r--platform/ios/framework/modulemap8
-rwxr-xr-xplatform/ios/framework/strip-frameworks.sh70
8 files changed, 260 insertions, 0 deletions
diff --git a/platform/ios/framework/Info.plist b/platform/ios/framework/Info.plist
new file mode 100644
index 0000000000..3bf250da27
--- /dev/null
+++ b/platform/ios/framework/Info.plist
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!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>${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.0.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0</string>
+</dict>
+</plist>
diff --git a/platform/ios/framework/Mapbox.h b/platform/ios/framework/Mapbox.h
new file mode 100644
index 0000000000..11f163376a
--- /dev/null
+++ b/platform/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 "MGLAccountManager.h"
+#import "MGLAnnotation.h"
+#import "MGLAnnotationImage.h"
+#import "MGLCalloutView.h"
+#import "MGLMapCamera.h"
+#import "MGLGeometry.h"
+#import "MGLMapView.h"
+#import "MGLMapView+IBAdditions.h"
+#import "MGLMapView+MGLCustomStyleLayerAdditions.h"
+#import "MGLMultiPoint.h"
+#import "MGLOverlay.h"
+#import "MGLPointAnnotation.h"
+#import "MGLPolygon.h"
+#import "MGLPolyline.h"
+#import "MGLShape.h"
+#import "MGLStyle.h"
+#import "MGLTypes.h"
+#import "MGLUserLocation.h"
diff --git a/platform/ios/framework/Mapbox.m b/platform/ios/framework/Mapbox.m
new file mode 100644
index 0000000000..93f58b9be6
--- /dev/null
+++ b/platform/ios/framework/Mapbox.m
@@ -0,0 +1,29 @@
+#import <Mapbox/Mapbox.h>
+
+#import "../src/NSBundle+MGLAdditions.h"
+#import "../src/NSProcessInfo+MGLAdditions.h"
+#import "../../darwin/src/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/platform/ios/framework/Settings.bundle/Root.plist b/platform/ios/framework/Settings.bundle/Root.plist
new file mode 100644
index 0000000000..889610e152
--- /dev/null
+++ b/platform/ios/framework/Settings.bundle/Root.plist
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>PreferenceSpecifiers</key>
+ <array>
+ <dict>
+ <key>Title</key>
+ <string>Privacy Settings</string>
+ <key>Type</key>
+ <string>PSGroupSpecifier</string>
+ <key>FooterText</key>
+ <string>This setting allows the application to share anonymized location and usage data with Mapbox.</string>
+ </dict>
+ <dict>
+ <key>DefaultValue</key>
+ <true/>
+ <key>Key</key>
+ <string>MGLMapboxMetricsEnabled</string>
+ <key>Title</key>
+ <string>Mapbox Telemetry</string>
+ <key>Type</key>
+ <string>PSToggleSwitchSpecifier</string>
+ <key>TrueValue</key>
+ <true/>
+ <key>FalseValue</key>
+ <false/>
+ </dict>
+ </array>
+ <key>StringsTable</key>
+ <string>Root</string>
+</dict>
+</plist>
diff --git a/platform/ios/framework/Settings.bundle/en.lproj/Root.strings b/platform/ios/framework/Settings.bundle/en.lproj/Root.strings
new file mode 100644
index 0000000000..e7658d692d
--- /dev/null
+++ b/platform/ios/framework/Settings.bundle/en.lproj/Root.strings
Binary files differ
diff --git a/platform/ios/framework/framework-ios.gypi b/platform/ios/framework/framework-ios.gypi
new file mode 100644
index 0000000000..1dcc2c0f9d
--- /dev/null
+++ b/platform/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': '../platform/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 ../platform/{darwin,ios}/include -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/platform/ios/framework/modulemap b/platform/ios/framework/modulemap
new file mode 100644
index 0000000000..122db0c2b1
--- /dev/null
+++ b/platform/ios/framework/modulemap
@@ -0,0 +1,8 @@
+framework module Mapbox {
+ umbrella header "Mapbox.h"
+ export *
+ module * { export * }
+ link "c++"
+ link "sqlite3"
+ link "z"
+}
diff --git a/platform/ios/framework/strip-frameworks.sh b/platform/ios/framework/strip-frameworks.sh
new file mode 100755
index 0000000000..9deb404ca1
--- /dev/null
+++ b/platform/ios/framework/strip-frameworks.sh
@@ -0,0 +1,70 @@
+################################################################################
+#
+# Copyright 2015 Realm Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+################################################################################
+
+# This script strips all non-valid architectures from dynamic libraries in
+# the application's `Frameworks` directory.
+#
+# The following environment variables are required:
+#
+# BUILT_PRODUCTS_DIR
+# FRAMEWORKS_FOLDER_PATH
+# VALID_ARCHS
+# EXPANDED_CODE_SIGN_IDENTITY
+
+
+# Signs a framework with the provided identity
+code_sign() {
+ # Use the current code_sign_identitiy
+ echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
+ echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements $1"
+ /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1"
+}
+
+echo "Stripping frameworks"
+cd "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}"
+
+for file in $(find . -type f -perm +111); do
+ # Skip non-dynamic libraries
+ if ! [[ "$(file "$file")" == *"dynamically linked shared library"* ]]; then
+ continue
+ fi
+ # Get architectures for current file
+ archs="$(lipo -info "${file}" | rev | cut -d ':' -f1 | rev)"
+ stripped=""
+ for arch in $archs; do
+ if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then
+ # Strip non-valid architectures in-place
+ lipo -remove "$arch" -output "$file" "$file" || exit 1
+ stripped="$stripped $arch"
+ fi
+ done
+ if [[ "$stripped" != "" ]]; then
+ echo "Stripped $file of architectures:$stripped"
+ if [ "${CODE_SIGNING_REQUIRED}" == "YES" ]; then
+ code_sign "${file}"
+ fi
+ fi
+done
+
+if [ "$ACTION" = "install" ]; then
+ echo "Copy .bcsymbolmap files to .xcarchive"
+ find . -name '*.bcsymbolmap' -type f -exec mv {} "${CONFIGURATION_BUILD_DIR}" \;
+else
+ # Delete *.bcsymbolmap files from framework bundle unless archiving
+ find . -name '*.bcsymbolmap' -type f -exec rm -rf "{}" +\;
+fi