diff options
33 files changed, 348 insertions, 327 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index c6f03a3d17..781c1ef367 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ Known issues: ## iOS master +- The SDK is now distributed as a dynamic framework instead of a static library, resulting in a simpler installation workflow and significantly reduced download size. The framework contains both simulator and device content; due to [an Xcode bug](http://www.openradar.me/radar?id=6409498411401216), you’ll need to strip out the simulator content before submitting your application to the App Store. ([#3183](https://github.com/mapbox/mapbox-gl-native/pull/3183)) - Fixed an issue causing the entire MGLMapView to leak. ([#3447](https://github.com/mapbox/mapbox-gl-native/pull/3447)) - `MGLMapView` methods that alter the viewport now accept optional completion handlers. ([#3090](https://github.com/mapbox/mapbox-gl-native/pull/3090)) - You can now modify an annotation’s image after adding the annotation to the map. ([#3146](https://github.com/mapbox/mapbox-gl-native/pull/3146)) @@ -48,12 +48,10 @@ isim: ; $(RUN) HOST=ios Xcode/iosapp ibench: export XCODEBUILD_ARGS += -sdk iphoneos ARCHS="arm64" ibench: ; $(RUN) HOST=ios Xcode/ios-bench -.PHONY: ipackage ipackage-strip ipackage-sim ipackage-no-bitcode itest +.PHONY: ipackage ipackage-strip ipackage-sim itest ipackage: Xcode/ios ; @JOBS=$(JOBS) ./platform/ios/scripts/package.sh ipackage-strip: Xcode/ios ; @JOBS=$(JOBS) ./platform/ios/scripts/package.sh strip ipackage-sim: Xcode/ios ; @JOBS=$(JOBS) ./platform/ios/scripts/package.sh sim -ipackage-no-bitcode: Xcode/ios ; @JOBS=$(JOBS) ./platform/ios/scripts/package.sh no-bitcode -iframework: ipackage-strip ; ./platform/ios/scripts/framework.sh itest: ipackage-sim ; ./platform/ios/scripts/test.sh .PHONY: xpackage xpackage-strip xctest diff --git a/gyp/ios.gyp b/gyp/ios.gyp index f26ec3772c..e015318c45 100644 --- a/gyp/ios.gyp +++ b/gyp/ios.gyp @@ -1,6 +1,7 @@ { 'includes': [ '../ios/app/mapboxgl-app.gypi', + '../ios/framework/framework-ios.gypi', '../ios/benchmark/benchmark-ios.gypi', ], } diff --git a/gyp/platform-ios.gypi b/gyp/platform-ios.gypi index 0c24663749..aab82387ed 100644 --- a/gyp/platform-ios.gypi +++ b/gyp/platform-ios.gypi @@ -1,6 +1,7 @@ { 'targets': [ - { 'target_name': 'platform-ios', + { + 'target_name': 'platform-ios', 'product_name': 'mbgl-platform-ios', 'type': 'static_library', 'standalone_static_library': 1, @@ -27,51 +28,31 @@ '../platform/darwin/NSException+MGLAdditions.h', '../platform/darwin/NSString+MGLAdditions.h', '../platform/darwin/NSString+MGLAdditions.m', - '../include/mbgl/darwin/MGLTypes.h', '../platform/darwin/MGLTypes.m', - '../include/mbgl/darwin/MGLStyle.h', '../platform/darwin/MGLStyle.mm', - '../include/mbgl/darwin/MGLGeometry.h', '../platform/darwin/MGLGeometry_Private.h', '../platform/darwin/MGLGeometry.mm', - '../include/mbgl/darwin/MGLAnnotation.h', - '../include/mbgl/darwin/MGLShape.h', '../platform/darwin/MGLShape.m', - '../include/mbgl/darwin/MGLMultiPoint.h', '../platform/darwin/MGLMultiPoint_Private.h', '../platform/darwin/MGLMultiPoint.mm', - '../include/mbgl/darwin/MGLOverlay.h', - '../include/mbgl/darwin/MGLPointAnnotation.h', '../platform/darwin/MGLPointAnnotation.m', - '../include/mbgl/darwin/MGLPolyline.h', '../platform/darwin/MGLPolyline.mm', - '../include/mbgl/darwin/MGLPolygon.h', '../platform/darwin/MGLPolygon.mm', - '../include/mbgl/darwin/MGLMapCamera.h', '../platform/darwin/MGLMapCamera.mm', - '../include/mbgl/ios/Mapbox.h', '../platform/ios/src/MGLMapboxEvents.h', '../platform/ios/src/MGLMapboxEvents.m', - '../include/mbgl/ios/MGLMapView.h', - '../include/mbgl/ios/MGLMapView+IBAdditions.h', - '../include/mbgl/ios/MGLMapView+MGLCustomStyleLayerAdditions.h', '../platform/ios/src/MGLMapView.mm', - '../include/mbgl/ios/MGLAccountManager.h', '../platform/ios/src/MGLAccountManager_Private.h', '../platform/ios/src/MGLAccountManager.m', - '../include/mbgl/ios/MGLUserLocation.h', '../platform/ios/src/MGLUserLocation_Private.h', '../platform/ios/src/MGLUserLocation.m', '../platform/ios/src/MGLUserLocationAnnotationView.h', '../platform/ios/src/MGLUserLocationAnnotationView.m', - '../include/mbgl/ios/MGLAnnotationImage.h', '../platform/ios/src/MGLAnnotationImage_Private.h', '../platform/ios/src/MGLAnnotationImage.m', '../include/mbgl/ios/MGLCalloutView.h', '../platform/ios/src/MGLCompactCalloutView.h', '../platform/ios/src/MGLCompactCalloutView.m', - '../platform/ios/src/MGLCategoryLoader.h', - '../platform/ios/src/MGLCategoryLoader.m', '../platform/ios/src/NSBundle+MGLAdditions.h', '../platform/ios/src/NSBundle+MGLAdditions.m', '../platform/ios/src/NSProcessInfo+MGLAdditions.h', @@ -82,7 +63,6 @@ '../platform/ios/vendor/Fabric/FABKitProtocol.h', '../platform/ios/vendor/Fabric/Fabric.h', '../platform/ios/vendor/Fabric/Fabric+FABKits.h', - '../platform/ios/resources/', ], 'variables': { @@ -93,21 +73,24 @@ '<@(sqlite_cflags)', '<@(zlib_cflags)', ], + 'ldflags': [ + '<@(sqlite_ldflags)', + '<@(zlib_ldflags)', + ], 'libraries': [ '<@(libuv_static_libs)', '<@(sqlite_static_libs)', '<@(zlib_static_libs)', - ], - 'ldflags': [ - '<@(sqlite_ldflags)', - '<@(zlib_ldflags)', - '-framework CoreLocation', - '-framework GLKit', - '-framework ImageIO', - '-framework MobileCoreServices', - '-framework QuartzCore', - '-framework SystemConfiguration', - '-ObjC', + '$(SDKROOT)/System/Library/Frameworks/CoreGraphics.framework', + '$(SDKROOT)/System/Library/Frameworks/CoreLocation.framework', + '$(SDKROOT)/System/Library/Frameworks/GLKit.framework', + '$(SDKROOT)/System/Library/Frameworks/ImageIO.framework', + '$(SDKROOT)/System/Library/Frameworks/MobileCoreServices.framework', + '$(SDKROOT)/System/Library/Frameworks/OpenGLES.framework', + '$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework', + '$(SDKROOT)/System/Library/Frameworks/Security.framework', + '$(SDKROOT)/System/Library/Frameworks/SystemConfiguration.framework', + '$(SDKROOT)/System/Library/Frameworks/UIKit.framework', ], }, @@ -138,7 +121,7 @@ '../include', ], 'mac_bundle_resources': [ - '<!@(find ../platform/ios/resources -type f \! -name "README")', + '<!@(find ../platform/ios/resources -type f \! -name "README" \! -name \'.*\')', ], }, }, diff --git a/ios/Mapbox-iOS-SDK.podspec b/ios/Mapbox-iOS-SDK.podspec index 052ba1447b..ec15132450 100644 --- a/ios/Mapbox-iOS-SDK.podspec +++ b/ios/Mapbox-iOS-SDK.podspec @@ -22,16 +22,7 @@ Pod::Spec.new do |m| m.requires_arc = true - m.preserve_paths = '**' - m.resource_bundle = { 'Mapbox' => 'Mapbox.framework/Mapbox.bundle/*' } - m.vendored_frameworks = 'Mapbox.framework' + m.vendored_frameworks = 'dynamic/Mapbox.framework' m.module_name = 'Mapbox' - m.frameworks = 'CoreLocation', 'GLKit', 'ImageIO', 'MobileCoreServices', 'QuartzCore', 'SystemConfiguration' - m.libraries = 'c++', 'sqlite3', 'z' - m.pod_target_xcconfig = { - 'OTHER_CPLUSPLUSFLAGS' => '-std=gnu++11 -stdlib=libc++', - 'OTHER_LDFLAGS' => '-ObjC', - } - end diff --git a/ios/app/MBXAppDelegate.m b/ios/app/MBXAppDelegate.m index bca039739a..a06424feb7 100644 --- a/ios/app/MBXAppDelegate.m +++ b/ios/app/MBXAppDelegate.m @@ -1,6 +1,6 @@ #import "MBXAppDelegate.h" #import "MBXViewController.h" -#import <mbgl/ios/Mapbox.h> +#import <Mapbox/Mapbox.h> @implementation MBXAppDelegate diff --git a/ios/app/MBXCustomCalloutView.h b/ios/app/MBXCustomCalloutView.h index 7f0a61bae3..a61619b79f 100644 --- a/ios/app/MBXCustomCalloutView.h +++ b/ios/app/MBXCustomCalloutView.h @@ -1,5 +1,5 @@ #import <UIKit/UIKit.h> -#import <mbgl/ios/MGLCalloutView.h> +#import <Mapbox/Mapbox.h> /** * Basic custom callout view to demonstrate how to diff --git a/ios/app/MBXCustomCalloutView.m b/ios/app/MBXCustomCalloutView.m index 0bbb9d99ed..8f9bd8ed40 100644 --- a/ios/app/MBXCustomCalloutView.m +++ b/ios/app/MBXCustomCalloutView.m @@ -1,7 +1,5 @@ #import "MBXCustomCalloutView.h" -#import <mbgl/darwin/MGLAnnotation.h> - static CGFloat const tipHeight = 10.0; static CGFloat const tipWidth = 10.0; diff --git a/ios/app/MBXViewController.mm b/ios/app/MBXViewController.mm index 6a2b0cc3fa..fddab78559 100644 --- a/ios/app/MBXViewController.mm +++ b/ios/app/MBXViewController.mm @@ -1,8 +1,8 @@ #import "MBXViewController.h" #import "MBXCustomCalloutView.h" -#import <mbgl/ios/Mapbox.h> -#import <mbgl/util/default_styles.hpp> +#import <Mapbox/Mapbox.h> +#import "../../include/mbgl/util/default_styles.hpp" #import <CoreLocation/CoreLocation.h> #import <OpenGLES/ES2/gl.h> diff --git a/ios/app/mapboxgl-app.gypi b/ios/app/mapboxgl-app.gypi index 4fa0ba6649..f154a10e9b 100644 --- a/ios/app/mapboxgl-app.gypi +++ b/ios/app/mapboxgl-app.gypi @@ -3,7 +3,8 @@ '../../gyp/common.gypi', ], 'targets': [ - { 'target_name': 'iosapp', + { + 'target_name': 'iosapp', 'product_name': 'Mapbox GL', 'type': 'executable', 'product_extension': 'app', @@ -14,50 +15,64 @@ './polyline.geojson', './threestates.geojson', './Settings.bundle/', - './app-info.plist' + './app-info.plist', ], 'dependencies': [ - 'mbgl.gyp:core', - 'mbgl.gyp:platform-<(platform_lib)', - 'mbgl.gyp:http-<(http_lib)', - 'mbgl.gyp:asset-<(asset_lib)', + 'iossdk', ], 'sources': [ - './main.m', - './MBXAppDelegate.h', - './MBXAppDelegate.m', - './MBXCustomCalloutView.h', - './MBXCustomCalloutView.m', - './MBXViewController.h', - './MBXViewController.mm', + 'main.m', + 'MBXAppDelegate.h', + 'MBXAppDelegate.m', + 'MBXCustomCalloutView.h', + 'MBXCustomCalloutView.m', + 'MBXViewController.h', + 'MBXViewController.mm', ], 'xcode_settings': { 'SDKROOT': 'iphoneos', 'SUPPORTED_PLATFORMS': 'iphonesimulator iphoneos', - 'IPHONEOS_DEPLOYMENT_TARGET': '7.0', + 'IPHONEOS_DEPLOYMENT_TARGET': '8.0', 'INFOPLIST_FILE': '../ios/app/app-info.plist', 'TARGETED_DEVICE_FAMILY': '1,2', - 'COMBINE_HIDPI_IMAGES': 'NO', # don't merge @2x.png images into .tiff files + 'COMBINE_HIDPI_IMAGES': 'NO', # disable combining @2x, @3x images into .tiff files + 'COPY_PHASE_STRIP': 'NO', 'CLANG_ENABLE_OBJC_ARC': 'YES', 'CLANG_ENABLE_MODULES': 'YES', + 'LD_RUNPATH_SEARCH_PATHS': [ + '$(inherited)', + '@executable_path/Frameworks', + ], }, 'configurations': { 'Debug': { 'xcode_settings': { 'CODE_SIGN_IDENTITY': 'iPhone Developer', + 'COPY_PHASE_STRIP': 'NO', }, }, 'Release': { 'xcode_settings': { 'CODE_SIGN_IDENTITY': 'iPhone Distribution', 'ARCHS': [ "armv7", "armv7s", "arm64", "i386", "x86_64" ], + 'COPY_PHASE_STRIP': 'YES', }, }, }, + + 'copies': [ + { + 'destination': '<(PRODUCT_DIR)/$(FRAMEWORKS_FOLDER_PATH)', + 'files': [ + '<(PRODUCT_DIR)/Mapbox.framework', + ], + 'xcode_code_sign': 1, + }, + ], } ] } 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[]; diff --git a/platform/ios/scripts/framework.sh b/platform/ios/scripts/framework.sh deleted file mode 100755 index e2842a4707..0000000000 --- a/platform/ios/scripts/framework.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail -set -u - -cd build/ios/pkg -rm -rf framework -mkdir framework -cd framework - -mkdir Mapbox.framework - -# headers -cp -rv ../static/Headers Mapbox.framework/Headers -cat ../../../../ios/framework/umbrella >> Mapbox.framework/Headers/Mapbox.h - -# resources -cp -rv ../static/Mapbox.bundle Mapbox.framework/Mapbox.bundle - -# license -cp -v ../../../../LICENSE.md Mapbox.framework - -# settings bundle -cp -rv ../../../../ios/framework/Settings.bundle Mapbox.framework/Settings.bundle - -# binary -cp -v ../static/libMapbox.a Mapbox.framework/Mapbox -strip -Sx Mapbox.framework/Mapbox - -# module map -mkdir Mapbox.framework/Modules -cp -v ../../../../ios/framework/modulemap Mapbox.framework/Modules/module.modulemap - -# Info.plist -VERSION=$( git tag | grep ^ios | sed 's/^ios-//' | sort -r | grep -v '\-rc.' | grep -v '\-pre.' | sed -n '1p' | sed 's/^v//' ) -echo "Using $VERSION for Info.plist. Note that you will need to manually update the product for pre-releases or release candidates." -cp -v ../../../../ios/framework/Info.plist Mapbox.framework -perl -pi -e "s/#####/$VERSION/" Mapbox.framework/Info.plist -perl -pi -e "s/%%%%%/$VERSION/" Mapbox.framework/Info.plist diff --git a/platform/ios/scripts/package.sh b/platform/ios/scripts/package.sh index 8faebb60e8..0d5808aea3 100755 --- a/platform/ios/scripts/package.sh +++ b/platform/ios/scripts/package.sh @@ -7,17 +7,11 @@ set -u NAME=Mapbox OUTPUT=build/ios/pkg LIBUV_VERSION=1.7.5 -ENABLE_BITCODE=YES if [[ ${#} -eq 0 ]]; then # e.g. "make ipackage" BUILDTYPE="Release" BUILD_FOR_DEVICE=true GCC_GENERATE_DEBUGGING_SYMBOLS="YES" -elif [[ ${1} == "no-bitcode" ]]; then # e.g. "make ipackage-no-bitcode" - BUILDTYPE="Release" - BUILD_FOR_DEVICE=true - GCC_GENERATE_DEBUGGING_SYMBOLS="YES" - ENABLE_BITCODE=NO elif [[ ${1} == "sim" ]]; then # e.g. "make ipackage-sim" BUILDTYPE="Debug" BUILD_FOR_DEVICE=false @@ -41,10 +35,11 @@ trap finish EXIT rm -rf ${OUTPUT} mkdir -p "${OUTPUT}"/static +mkdir -p "${OUTPUT}"/dynamic -step "Recording library version..." -VERSION="${OUTPUT}"/static/version.txt +step "Recording library version…" +VERSION="${OUTPUT}"/version.txt echo -n "https://github.com/mapbox/mapbox-gl-native/commit/" > ${VERSION} HASH=`git log | head -1 | awk '{ print $2 }' | cut -c 1-10` && true echo -n "mapbox-gl-native " @@ -52,27 +47,44 @@ echo ${HASH} echo ${HASH} >> ${VERSION} -step "Creating build files..." +step "Creating build files…" export MASON_PLATFORM=ios export BUILDTYPE=${BUILDTYPE:-Release} export HOST=ios make Xcode/ios +PROJ_VERSION=${TRAVIS_JOB_NUMBER:-${BITRISE_BUILD_NUMBER:-0}} + if [[ "${BUILD_FOR_DEVICE}" == true ]]; then - step "Building iOS device targets..." + step "Building intermediate static libraries for iOS devices (build ${PROJ_VERSION})…" xcodebuild -sdk iphoneos${IOS_SDK_VERSION} \ ARCHS="arm64 armv7 armv7s" \ ONLY_ACTIVE_ARCH=NO \ GCC_GENERATE_DEBUGGING_SYMBOLS=${GCC_GENERATE_DEBUGGING_SYMBOLS} \ - ENABLE_BITCODE=${ENABLE_BITCODE} \ + ENABLE_BITCODE=NO \ DEPLOYMENT_POSTPROCESSING=YES \ -project ./build/ios-all/gyp/mbgl.xcodeproj \ -configuration ${BUILDTYPE} \ -target everything \ -jobs ${JOBS} + + step "Building dynamic framework for iOS devices (build ${PROJ_VERSION})…" + xcodebuild -sdk iphoneos${IOS_SDK_VERSION} \ + ARCHS="arm64 armv7 armv7s" \ + ONLY_ACTIVE_ARCH=NO \ + GCC_GENERATE_DEBUGGING_SYMBOLS=${GCC_GENERATE_DEBUGGING_SYMBOLS} \ + ENABLE_BITCODE=YES \ + DEPLOYMENT_POSTPROCESSING=YES \ + CURRENT_PROJECT_VERSION=${PROJ_VERSION} \ + CODE_SIGNING_REQUIRED=NO \ + CODE_SIGN_IDENTITY= \ + -project ./build/ios-all/gyp/ios.xcodeproj \ + -configuration ${BUILDTYPE} \ + -target iossdk \ + -jobs ${JOBS} fi -step "Building iOS Simulator targets..." +step "Building intermediate static libraries for iOS Simulator (build ${PROJ_VERSION})…" xcodebuild -sdk iphonesimulator${IOS_SDK_VERSION} \ ARCHS="x86_64 i386" \ ONLY_ACTIVE_ARCH=NO \ @@ -82,54 +94,88 @@ xcodebuild -sdk iphonesimulator${IOS_SDK_VERSION} \ -target everything \ -jobs ${JOBS} +step "Building dynamic framework for iOS Simulator (build ${PROJ_VERSION})…" +xcodebuild -sdk iphonesimulator${IOS_SDK_VERSION} \ + ARCHS="x86_64 i386" \ + ONLY_ACTIVE_ARCH=NO \ + GCC_GENERATE_DEBUGGING_SYMBOLS=${GCC_GENERATE_DEBUGGING_SYMBOLS} \ + ENABLE_BITCODE=YES \ + CURRENT_PROJECT_VERSION=${PROJ_VERSION} \ + -project ./build/ios-all/gyp/ios.xcodeproj \ + -configuration ${BUILDTYPE} \ + -target iossdk \ + -jobs ${JOBS} -step "Building static library..." LIBS=(core.a platform-ios.a asset-fs.a http-nsurl.a) + +# https://medium.com/@syshen/create-an-ios-universal-framework-148eb130a46c if [[ "${BUILD_FOR_DEVICE}" == true ]]; then + step "Assembling static framework for iOS Simulator and devices…" + mkdir -p ${OUTPUT}/static/${NAME}.framework libtool -static -no_warning_for_no_symbols \ `find mason_packages/ios-${IOS_SDK_VERSION} -type f -name libuv.a` \ `find mason_packages/ios-${IOS_SDK_VERSION} -type f -name libgeojsonvt.a` \ - -o ${OUTPUT}/static/lib${NAME}.a \ + -o ${OUTPUT}/static/${NAME}.framework/${NAME} \ ${LIBS[@]/#/gyp/build/${BUILDTYPE}-iphoneos/libmbgl-} \ ${LIBS[@]/#/gyp/build/${BUILDTYPE}-iphonesimulator/libmbgl-} + + step "Copying dynamic framework into place for iOS devices" + cp -r \ + gyp/build/${BUILDTYPE}-iphoneos/${NAME}.framework \ + ${OUTPUT}/dynamic/ + + step "Merging simulator dynamic library into device dynamic library…" + lipo \ + gyp/build/${BUILDTYPE}-iphoneos/${NAME}.framework/${NAME} \ + gyp/build/${BUILDTYPE}-iphonesimulator/${NAME}.framework/${NAME} \ + -create -output ${OUTPUT}/dynamic/${NAME}.framework/${NAME} | echo else + step "Assembling static library for iOS Simulator…" + mkdir -p ${OUTPUT}/static/${NAME}.framework libtool -static -no_warning_for_no_symbols \ `find mason_packages/ios-${IOS_SDK_VERSION} -type f -name libuv.a` \ `find mason_packages/ios-${IOS_SDK_VERSION} -type f -name libgeojsonvt.a` \ -o ${OUTPUT}/static/lib${NAME}.a \ ${LIBS[@]/#/gyp/build/${BUILDTYPE}-iphonesimulator/libmbgl-} + + step "Copying dynamic framework into place for iOS Simulator…" + cp -r \ + gyp/build/${BUILDTYPE}-iphonesimulator/${NAME}.framework \ + ${OUTPUT}/dynamic/${NAME}.framework fi -echo "Created ${OUTPUT}/static/lib${NAME}.a" +if [[ "${GCC_GENERATE_DEBUGGING_SYMBOLS}" == false ]]; then + step "Stripping binaries…" + strip -Sx "${OUTPUT}/static/${NAME}.framework/${NAME}" + strip -Sx "${OUTPUT}/dynamic/${NAME}.framework/${NAME}" +fi -step "Copying Headers..." -mkdir -p "${OUTPUT}/static/Headers" -for i in `ls -R include/mbgl/darwin | grep -vi private`; do - cp -pv include/mbgl/darwin/$i "${OUTPUT}/static/Headers" -done -for i in `ls -R include/mbgl/ios | grep -vi private`; do - cp -pv include/mbgl/ios/$i "${OUTPUT}/static/Headers" -done +stat "${OUTPUT}/static/${NAME}.framework" +stat "${OUTPUT}/dynamic/${NAME}.framework" +step "Copying static library headers…" +mkdir -p "${OUTPUT}/static/${NAME}.framework/Headers" +cp -pv include/mbgl/{darwin,ios}/*.h "${OUTPUT}/static/${NAME}.framework/Headers" -# Manually create resource bundle. We don't use a GYP target here because of -# complications between faked GYP bundles-as-executables, device build -# dependencies, and code signing. -step "Copying Resources..." -cp -pv LICENSE.md "${OUTPUT}/static" -mkdir -p "${OUTPUT}/static/${NAME}.bundle" -cp -pv platform/ios/resources/* "${OUTPUT}/static/${NAME}.bundle" +step "Copying library resources…" +cp -pv LICENSE.md "${OUTPUT}" +cp -rv ios/app/Settings.bundle "${OUTPUT}" +cp -pv platform/ios/resources/* "${OUTPUT}/static/${NAME}.framework" +cp -pv ios/framework/Info.plist "${OUTPUT}/static/${NAME}.framework/Info.plist" +perl -pi -e "s/(?<=<string>)0(?=<\/string>)/${PROJ_VERSION}/g" "${OUTPUT}/static/${NAME}.framework/Info.plist" +mkdir "${OUTPUT}/static/${NAME}.framework/Modules" +cp -pv ios/framework/modulemap "${OUTPUT}/static/${NAME}.framework/Modules/module.modulemap" -step "Creating API Docs..." +step "Generating API documentation…" if [ -z `which jazzy` ]; then - step "Installing jazzy..." + step "Installing jazzy…" gem install jazzy if [ -z `which jazzy` ]; then echo "Unable to install jazzy. See https://github.com/mapbox/mapbox-gl-native/blob/master/platform/ios/INSTALL.md" exit 1 fi fi -DOCS_OUTPUT="${OUTPUT}/static/Docs" +DOCS_OUTPUT="${OUTPUT}/documentation" DOCS_VERSION=$( git tag | grep ^ios | sed 's/^ios-//' | sort -r | grep -v '\-rc.' | grep -v '\-pre.' | sed -n '1p' | sed 's/^v//' ) rm -rf /tmp/mbgl mkdir -p /tmp/mbgl/ diff --git a/platform/ios/scripts/publish.sh b/platform/ios/scripts/publish.sh index c914fcaccd..bdfbc94314 100755 --- a/platform/ios/scripts/publish.sh +++ b/platform/ios/scripts/publish.sh @@ -19,7 +19,7 @@ fi # # zip # -cd build/ios/pkg/static +cd build/ios/pkg ZIP=mapbox-ios-sdk-${PUBLISH_VERSION}${PUBLISH_STYLE}.zip rm -f ../${ZIP} zip -r ../${ZIP} * diff --git a/platform/ios/scripts/run.sh b/platform/ios/scripts/run.sh index bfca74d318..02699f29b6 100755 --- a/platform/ios/scripts/run.sh +++ b/platform/ios/scripts/run.sh @@ -31,13 +31,6 @@ if [[ ${PUBLISH_PLATFORM} = 'ios' ]]; then mapbox_time "deploy_ios_stripped" ./platform/ios/scripts/publish.sh "${PUBLISH_VERSION}" - - # debug symbols but no Bitcode - mapbox_time "package_ios_no_bitcode" \ - make ipackage-no-bitcode - - mapbox_time "deploy_ios_no_bitcode" - ./platform/ios/scripts/publish.sh "${PUBLISH_VERSION}" no-bitcode else # build & test iOS mapbox_time "run_ios_tests" \ diff --git a/platform/ios/src/MGLAccountManager.m b/platform/ios/src/MGLAccountManager.m index c5aeae7077..9b60a40986 100644 --- a/platform/ios/src/MGLAccountManager.m +++ b/platform/ios/src/MGLAccountManager.m @@ -1,6 +1,5 @@ #import "MGLAccountManager_Private.h" #import "MGLMapboxEvents.h" -#import "MGLCategoryLoader.h" #import "NSProcessInfo+MGLAdditions.h" #import "FABKitProtocol.h" @@ -17,9 +16,6 @@ #pragma mark - Internal + (void)load { - // Load all referenced categories due to absence of -ObjC linker flag - [MGLCategoryLoader loadCategories]; - // Read the initial configuration from Info.plist. NSString *accessToken = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"MGLMapboxAccessToken"]; if (accessToken.length) { diff --git a/platform/ios/src/MGLCategoryLoader.h b/platform/ios/src/MGLCategoryLoader.h deleted file mode 100644 index 874450d148..0000000000 --- a/platform/ios/src/MGLCategoryLoader.h +++ /dev/null @@ -1,7 +0,0 @@ -#import <Foundation/Foundation.h> - -@interface MGLCategoryLoader : NSObject - -+ (void)loadCategories; - -@end diff --git a/platform/ios/src/MGLCategoryLoader.m b/platform/ios/src/MGLCategoryLoader.m deleted file mode 100644 index 9b66be73d8..0000000000 --- a/platform/ios/src/MGLCategoryLoader.m +++ /dev/null @@ -1,24 +0,0 @@ -#import "MGLCategoryLoader.h" - -#import "NSBundle+MGLAdditions.h" -#import "NSProcessInfo+MGLAdditions.h" -#import "NSString+MGLAdditions.h" - -#import "MGLMapView.h" - -@implementation MGLCategoryLoader - -+ (void)loadCategories -{ - // https://github.com/mapbox/mapbox-gl-native/issues/2966 - // - mgl_linkBundleCategory(); - mgl_linkProcessCategory(); - mgl_linkStringCategory(); - - // https://github.com/mapbox/mapbox-gl-native/issues/3113 - // - [MGLMapView description]; -} - -@end diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 3cb8209f1d..ebcc62eba6 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -3529,25 +3529,24 @@ std::chrono::steady_clock::duration MGLDurationInSeconds(float duration) + (UIImage *)resourceImageNamed:(NSString *)imageName { - if ( ! [[imageName pathExtension] length]) - { - imageName = [imageName stringByAppendingString:@".png"]; - } - - return [UIImage imageWithContentsOfFile:[self pathForBundleResourceNamed:imageName ofType:nil inDirectory:@""]]; -} - -+ (NSString *)pathForBundleResourceNamed:(NSString *)name ofType:(NSString *)extension inDirectory:(NSString *)directory -{ - NSString *path = [[NSBundle bundleWithPath:[NSBundle mgl_resourceBundlePath]] pathForResource:name ofType:extension inDirectory:directory]; - - if (!path) + NSString *extension = imageName.pathExtension.length ? imageName.pathExtension : @"png"; + NSBundle *bundle = [NSBundle mgl_frameworkBundle]; + NSString *directory = nil; + if (![bundle.infoDictionary[@"CFBundlePackageType"] isEqualToString:@"FMWK"]) { + // For static libraries, the bundle is the containing application bundle + // and the resources are in a bundle alongside the static library. + directory = @"Mapbox.bundle"; + } + NSString *path = [bundle pathForResource:imageName.stringByDeletingPathExtension + ofType:extension + inDirectory:directory]; + if ( ! path) { [NSException raise:@"Resource not found" format: - @"The resource named “%@” could not be found in the Mapbox resource bundle.", name]; + @"The resource named “%@” could not be found in the Mapbox resource bundle.", imageName]; } - - return path; + + return [UIImage imageWithContentsOfFile:path]; } - (BOOL)isFullyLoaded diff --git a/platform/ios/src/MGLMapboxEvents.m b/platform/ios/src/MGLMapboxEvents.m index 6654cc6ac5..8aa790c41f 100644 --- a/platform/ios/src/MGLMapboxEvents.m +++ b/platform/ios/src/MGLMapboxEvents.m @@ -220,7 +220,7 @@ const NSTimeInterval MGLFlushInterval = 60; _paused = YES; [self resumeMetricsCollection]; - NSBundle *resourceBundle = [NSBundle bundleWithPath:[NSBundle mgl_resourceBundlePath]]; + NSBundle *resourceBundle = [NSBundle mgl_frameworkBundle]; // Load Local Copy of Server's Public Key NSString *cerPath = nil; diff --git a/platform/ios/src/NSBundle+MGLAdditions.h b/platform/ios/src/NSBundle+MGLAdditions.h index a86e85f79b..6d6ebc35ad 100644 --- a/platform/ios/src/NSBundle+MGLAdditions.h +++ b/platform/ios/src/NSBundle+MGLAdditions.h @@ -8,7 +8,7 @@ void mgl_linkBundleCategory(); @interface NSBundle (MGLAdditions) -+ (NSString *)mgl_resourceBundlePath; ++ (instancetype)mgl_frameworkBundle; @end diff --git a/platform/ios/src/NSBundle+MGLAdditions.m b/platform/ios/src/NSBundle+MGLAdditions.m index d5842ea596..05d8f5c87c 100644 --- a/platform/ios/src/NSBundle+MGLAdditions.m +++ b/platform/ios/src/NSBundle+MGLAdditions.m @@ -1,31 +1,14 @@ #import "NSBundle+MGLAdditions.h" -#import "MGLMapView.h" +#import "MGLAccountManager.h" -@implementation NSBundle (MGLAdditions) +void mgl_linkBundleCategory() {} -void mgl_linkBundleCategory(){} +@implementation NSBundle (MGLAdditions) -+ (NSString *)mgl_resourceBundlePath ++ (instancetype)mgl_frameworkBundle { - NSString *resourceBundlePath = nil; - - // check for resource bundle in framework bundle (Fabric, premade framework) - // - NSString *frameworkBundlePath = [NSString stringWithFormat:@"%@/Mapbox.framework/Mapbox.bundle", - [[NSBundle mainBundle] privateFrameworksPath]]; - if ([NSBundle bundleWithPath:frameworkBundlePath]) resourceBundlePath = frameworkBundlePath; - - // check for resource bundle in app bundle (static library) - // - if ( ! resourceBundlePath) resourceBundlePath = [[NSBundle bundleForClass: - [MGLMapView class]] pathForResource:@"Mapbox" ofType:@"bundle"]; - - // fall back to resources directly in app bundle (test app) - // - if ( ! resourceBundlePath) resourceBundlePath = [[NSBundle mainBundle] bundlePath]; - - return resourceBundlePath; + return [self bundleForClass:[MGLAccountManager class]]; } @end diff --git a/platform/ios/src/NSProcessInfo+MGLAdditions.h b/platform/ios/src/NSProcessInfo+MGLAdditions.h index b97979ddb4..6b34f54756 100644 --- a/platform/ios/src/NSProcessInfo+MGLAdditions.h +++ b/platform/ios/src/NSProcessInfo+MGLAdditions.h @@ -1,6 +1,6 @@ #import <Foundation/Foundation.h> -void mgl_linkProcessCategory(); +void mgl_linkProcessInfoCategory(); @interface NSProcessInfo (MGLAdditions) diff --git a/platform/ios/src/NSProcessInfo+MGLAdditions.m b/platform/ios/src/NSProcessInfo+MGLAdditions.m index 1f12f7256e..73d76bc17f 100644 --- a/platform/ios/src/NSProcessInfo+MGLAdditions.m +++ b/platform/ios/src/NSProcessInfo+MGLAdditions.m @@ -2,7 +2,7 @@ @implementation NSProcessInfo (MGLAdditions) -void mgl_linkProcessCategory(){} +void mgl_linkProcessInfoCategory() {} - (BOOL)mgl_isInterfaceBuilderDesignablesAgent { diff --git a/test/ios/KIFTestActor+MapboxGL.m b/test/ios/KIFTestActor+MapboxGL.m index 6ebd248448..6c5e53f40d 100644 --- a/test/ios/KIFTestActor+MapboxGL.m +++ b/test/ios/KIFTestActor+MapboxGL.m @@ -1,6 +1,6 @@ #import "KIFTestActor+MapboxGL.h" -#import "Mapbox.h" +#import <Mapbox/Mapbox.h> #import <KIF/UIApplication-KIFAdditions.h> diff --git a/test/ios/MGLTAppDelegate.m b/test/ios/MGLTAppDelegate.m index ba49f96d22..b79c2f4abb 100644 --- a/test/ios/MGLTAppDelegate.m +++ b/test/ios/MGLTAppDelegate.m @@ -1,6 +1,6 @@ #import "MGLTAppDelegate.h" #import "MGLTViewController.h" -#import "Mapbox.h" +#import <Mapbox/Mapbox.h> @implementation MGLTAppDelegate diff --git a/test/ios/MGLTViewController.m b/test/ios/MGLTViewController.m index 01a053f50d..09c60bf614 100644 --- a/test/ios/MGLTViewController.m +++ b/test/ios/MGLTViewController.m @@ -1,5 +1,5 @@ #import "MGLTViewController.h" -#import "Mapbox.h" +#import <Mapbox/Mapbox.h> @implementation MGLTViewController { diff --git a/test/ios/MapViewTests.m b/test/ios/MapViewTests.m index 198888ee6e..40022a1ee5 100644 --- a/test/ios/MapViewTests.m +++ b/test/ios/MapViewTests.m @@ -3,7 +3,7 @@ #import "KIFTestActor+MapboxGL.h" -#import "Mapbox.h" +#import <Mapbox/Mapbox.h> #import "MGLTViewController.h" #import <CoreLocation/CoreLocation.h> diff --git a/test/ios/ios-tests.xcodeproj/project.pbxproj b/test/ios/ios-tests.xcodeproj/project.pbxproj index 0a60c89073..282bcc209e 100644 --- a/test/ios/ios-tests.xcodeproj/project.pbxproj +++ b/test/ios/ios-tests.xcodeproj/project.pbxproj @@ -7,14 +7,14 @@ objects = { /* Begin PBXBuildFile section */ - 7D3A84F41BC844970041A655 /* libgeojsonvt.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7D3A84F31BC844970041A655 /* libgeojsonvt.a */; }; 96567A231B0E84CD00D78776 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 96567A221B0E84CD00D78776 /* LaunchScreen.xib */; }; 96567A311B0E8BB900D78776 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96567A301B0E8BB900D78776 /* Images.xcassets */; }; + DA482C801C12582600772FE3 /* Mapbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA482C7F1C12582600772FE3 /* Mapbox.framework */; }; + DA482C811C12582600772FE3 /* Mapbox.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = DA482C7F1C12582600772FE3 /* Mapbox.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; DD043363196DBBD500E6F39D /* MGLTAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DD04335F196DBBD500E6F39D /* MGLTAppDelegate.m */; }; DD043364196DBBD500E6F39D /* MGLTViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DD043360196DBBD500E6F39D /* MGLTViewController.m */; }; DD043366196DBBE000E6F39D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DD043365196DBBE000E6F39D /* main.m */; }; DD0580E81ACB628200B112C9 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD0580E71ACB628200B112C9 /* IOKit.framework */; }; - DD0581041ACB661200B112C9 /* Headers in Resources */ = {isa = PBXBuildFile; fileRef = DD0581031ACB661200B112C9 /* Headers */; }; DD0E6F841B0190E200DC035A /* libOCMock.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DD0E6F701B0190E200DC035A /* libOCMock.a */; }; DD0E6F981B01B68E00DC035A /* OHHTTPStubs.m in Sources */ = {isa = PBXBuildFile; fileRef = DD0E6F8E1B01B68E00DC035A /* OHHTTPStubs.m */; }; DD0E6F991B01B68E00DC035A /* OHHTTPStubs+NSURLSessionConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = DD0E6F8F1B01B68E00DC035A /* OHHTTPStubs+NSURLSessionConfiguration.m */; }; @@ -22,18 +22,9 @@ DD0E6F9B1B01B68E00DC035A /* OHHTTPStubsResponse+HTTPMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = DD0E6F931B01B68E00DC035A /* OHHTTPStubsResponse+HTTPMessage.m */; }; DD0E6F9C1B01B68E00DC035A /* OHHTTPStubsResponse+JSON.m in Sources */ = {isa = PBXBuildFile; fileRef = DD0E6F951B01B68E00DC035A /* OHHTTPStubsResponse+JSON.m */; }; DD0E6F9D1B01B68E00DC035A /* OHPathHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = DD0E6F971B01B68E00DC035A /* OHPathHelpers.m */; }; - DD41CE0B1ACB5DC400FA7979 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD41CE0A1ACB5DC400FA7979 /* SystemConfiguration.framework */; }; - DD41CE0D1ACB5DCB00FA7979 /* libc++.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = DD41CE0C1ACB5DCB00FA7979 /* libc++.dylib */; }; - DD41CE0F1ACB5DD000FA7979 /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = DD41CE0E1ACB5DD000FA7979 /* libsqlite3.dylib */; }; - DD41CE111ACB5DD500FA7979 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = DD41CE101ACB5DD500FA7979 /* libz.dylib */; }; - DD41CE131ACB5DDA00FA7979 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD41CE121ACB5DDA00FA7979 /* MobileCoreServices.framework */; }; - DD41CE151ACB5DE000FA7979 /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD41CE141ACB5DE000FA7979 /* ImageIO.framework */; }; - DD41CE171ACB5DE700FA7979 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD41CE161ACB5DE700FA7979 /* GLKit.framework */; }; DDBD016C196DC4740033959E /* MapViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DDBD0168196DC4740033959E /* MapViewTests.m */; }; DDBD016D196DC4740033959E /* KIFTestActor+MapboxGL.m in Sources */ = {isa = PBXBuildFile; fileRef = DDBD016A196DC4740033959E /* KIFTestActor+MapboxGL.m */; }; DDBD016E196DC4A10033959E /* libKIF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DDBD0144196DC3AE0033959E /* libKIF.a */; }; - DDC5C7BC1B84D62B00E1EA6B /* libMapbox.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DDC5C7BA1B84D62B00E1EA6B /* libMapbox.a */; }; - DDC5C7BD1B84D62B00E1EA6B /* Mapbox.bundle in Resources */ = {isa = PBXBuildFile; fileRef = DDC5C7BB1B84D62B00E1EA6B /* Mapbox.bundle */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -74,10 +65,24 @@ }; /* End PBXContainerItemProxy section */ +/* Begin PBXCopyFilesBuildPhase section */ + DA482C821C12582600772FE3 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + DA482C811C12582600772FE3 /* Mapbox.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ - 7D3A84F31BC844970041A655 /* libgeojsonvt.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libgeojsonvt.a; path = "../../mason_packages/ios-9.0/geojsonvt/2.1.6/lib/libgeojsonvt.a"; sourceTree = "<group>"; }; 96567A221B0E84CD00D78776 /* LaunchScreen.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LaunchScreen.xib; sourceTree = SOURCE_ROOT; }; 96567A301B0E8BB900D78776 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = SOURCE_ROOT; }; + DA482C7F1C12582600772FE3 /* Mapbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Mapbox.framework; path = ../../build/ios/pkg/dynamic/Mapbox.framework; sourceTree = "<group>"; }; DACAD7111B08719F009119DC /* MGLMapboxEvents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MGLMapboxEvents.h; path = ../../platform/ios/MGLMapboxEvents.h; sourceTree = SOURCE_ROOT; }; DADD9EB51BD16D8B00DA9161 /* Compatibility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Compatibility.h; path = OHHTTPStubs/OHHTTPStubs/Sources/Compatibility.h; sourceTree = SOURCE_ROOT; }; DD043323196DB9BC00E6F39D /* Mapbox GL Tests.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Mapbox GL Tests.app"; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -88,8 +93,6 @@ DD043365196DBBE000E6F39D /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = SOURCE_ROOT; }; DD043367196DBCC200E6F39D /* App-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "App-Info.plist"; sourceTree = SOURCE_ROOT; }; DD0580E71ACB628200B112C9 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/IOKit.framework; sourceTree = DEVELOPER_DIR; }; - DD0580EF1ACB62BE00B112C9 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - DD0581031ACB661200B112C9 /* Headers */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Headers; path = ../../build/ios/pkg/static/Headers; sourceTree = SOURCE_ROOT; }; DD0E6F701B0190E200DC035A /* libOCMock.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libOCMock.a; path = OCMock/libOCMock.a; sourceTree = SOURCE_ROOT; }; DD0E6F721B0190E200DC035A /* NSNotificationCenter+OCMAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSNotificationCenter+OCMAdditions.h"; sourceTree = "<group>"; }; DD0E6F731B0190E200DC035A /* OCMArg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMArg.h; sourceTree = "<group>"; }; @@ -111,23 +114,12 @@ DD0E6F951B01B68E00DC035A /* OHHTTPStubsResponse+JSON.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "OHHTTPStubsResponse+JSON.m"; path = "OHHTTPStubs/OHHTTPStubs/Sources/OHHTTPStubsResponse+JSON.m"; sourceTree = SOURCE_ROOT; }; DD0E6F961B01B68E00DC035A /* OHPathHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OHPathHelpers.h; path = OHHTTPStubs/OHHTTPStubs/Sources/OHPathHelpers.h; sourceTree = SOURCE_ROOT; }; DD0E6F971B01B68E00DC035A /* OHPathHelpers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OHPathHelpers.m; path = OHHTTPStubs/OHHTTPStubs/Sources/OHPathHelpers.m; sourceTree = SOURCE_ROOT; }; - DD41CE061ACB5DB300FA7979 /* libMapboxGL.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libMapboxGL.a; path = ../../build/ios/pkg/static/libMapboxGL.a; sourceTree = "<group>"; }; - DD41CE081ACB5DBC00FA7979 /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; }; - DD41CE0A1ACB5DC400FA7979 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; - DD41CE0C1ACB5DCB00FA7979 /* libc++.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libc++.dylib"; path = "usr/lib/libc++.dylib"; sourceTree = SDKROOT; }; - DD41CE0E1ACB5DD000FA7979 /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; }; - DD41CE101ACB5DD500FA7979 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; - DD41CE121ACB5DDA00FA7979 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; }; - DD41CE141ACB5DE000FA7979 /* ImageIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = System/Library/Frameworks/ImageIO.framework; sourceTree = SDKROOT; }; - DD41CE161ACB5DE700FA7979 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; DDBD013A196DC3AE0033959E /* KIF.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = KIF.xcodeproj; path = KIF/KIF.xcodeproj; sourceTree = SOURCE_ROOT; }; DDBD0152196DC3D70033959E /* Test Bundle.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Test Bundle.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; DDBD0165196DC4560033959E /* Bundle-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Bundle-Info.plist"; sourceTree = SOURCE_ROOT; }; DDBD0168196DC4740033959E /* MapViewTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MapViewTests.m; sourceTree = SOURCE_ROOT; }; DDBD016A196DC4740033959E /* KIFTestActor+MapboxGL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "KIFTestActor+MapboxGL.m"; sourceTree = SOURCE_ROOT; }; DDBD016B196DC4740033959E /* KIFTestActor+MapboxGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "KIFTestActor+MapboxGL.h"; sourceTree = SOURCE_ROOT; }; - DDC5C7BA1B84D62B00E1EA6B /* libMapbox.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libMapbox.a; path = ../../../build/ios/pkg/static/libMapbox.a; sourceTree = "<group>"; }; - DDC5C7BB1B84D62B00E1EA6B /* Mapbox.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = Mapbox.bundle; path = ../../../build/ios/pkg/static/Mapbox.bundle; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -135,15 +127,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - DD41CE171ACB5DE700FA7979 /* GLKit.framework in Frameworks */, - DD41CE151ACB5DE000FA7979 /* ImageIO.framework in Frameworks */, - DD41CE131ACB5DDA00FA7979 /* MobileCoreServices.framework in Frameworks */, - DDC5C7BC1B84D62B00E1EA6B /* libMapbox.a in Frameworks */, - DD41CE0B1ACB5DC400FA7979 /* SystemConfiguration.framework in Frameworks */, - DD41CE0D1ACB5DCB00FA7979 /* libc++.dylib in Frameworks */, - DD41CE0F1ACB5DD000FA7979 /* libsqlite3.dylib in Frameworks */, - DD41CE111ACB5DD500FA7979 /* libz.dylib in Frameworks */, - 7D3A84F41BC844970041A655 /* libgeojsonvt.a in Frameworks */, + DA482C801C12582600772FE3 /* Mapbox.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -163,6 +147,7 @@ DD04331A196DB9BC00E6F39D = { isa = PBXGroup; children = ( + DA482C7F1C12582600772FE3 /* Mapbox.framework */, DD04332C196DB9BC00E6F39D /* App */, DDBD0139196DC38D0033959E /* Tests */, DD043325196DB9BC00E6F39D /* Frameworks */, @@ -182,18 +167,7 @@ DD043325196DB9BC00E6F39D /* Frameworks */ = { isa = PBXGroup; children = ( - 7D3A84F31BC844970041A655 /* libgeojsonvt.a */, - DD0580EF1ACB62BE00B112C9 /* CoreGraphics.framework */, - DD41CE081ACB5DBC00FA7979 /* CoreTelephony.framework */, - DD41CE161ACB5DE700FA7979 /* GLKit.framework */, DD0580E71ACB628200B112C9 /* IOKit.framework */, - DD41CE141ACB5DE000FA7979 /* ImageIO.framework */, - DD41CE121ACB5DDA00FA7979 /* MobileCoreServices.framework */, - DD41CE0A1ACB5DC400FA7979 /* SystemConfiguration.framework */, - DD41CE061ACB5DB300FA7979 /* libMapboxGL.a */, - DD41CE0C1ACB5DCB00FA7979 /* libc++.dylib */, - DD41CE0E1ACB5DD000FA7979 /* libsqlite3.dylib */, - DD41CE101ACB5DD500FA7979 /* libz.dylib */, ); name = Frameworks; sourceTree = "<group>"; @@ -271,10 +245,7 @@ DDAE739B1ACB557500E1A793 /* GL Library */ = { isa = PBXGroup; children = ( - DD0581031ACB661200B112C9 /* Headers */, DACAD7111B08719F009119DC /* MGLMapboxEvents.h */, - DDC5C7BA1B84D62B00E1EA6B /* libMapbox.a */, - DDC5C7BB1B84D62B00E1EA6B /* Mapbox.bundle */, ); name = "GL Library"; sourceTree = "<group>"; @@ -331,6 +302,7 @@ DD04331F196DB9BC00E6F39D /* Sources */, DD043320196DB9BC00E6F39D /* Frameworks */, DD043321196DB9BC00E6F39D /* Resources */, + DA482C821C12582600772FE3 /* Embed Frameworks */, ); buildRules = ( ); @@ -436,8 +408,6 @@ buildActionMask = 2147483647; files = ( 96567A311B0E8BB900D78776 /* Images.xcassets in Resources */, - DD0581041ACB661200B112C9 /* Headers in Resources */, - DDC5C7BD1B84D62B00E1EA6B /* Mapbox.bundle in Resources */, 96567A231B0E84CD00D78776 /* LaunchScreen.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -521,7 +491,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 7.1; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -555,7 +525,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 7.1; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; @@ -567,19 +537,19 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - HEADER_SEARCH_PATHS = ( + FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, - "../../build/ios/pkg/static/**", + "$(PROJECT_DIR)/../../build/ios/pkg/dynamic/", ); + HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = "$(SRCROOT)/App-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", - ../../build/ios/pkg/static, "../../mason_packages/**", ); - OTHER_LDFLAGS = "-ObjC"; + OTHER_LDFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = "com.mapbox.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "1,2"; @@ -592,19 +562,19 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - HEADER_SEARCH_PATHS = ( + FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, - "../../build/ios/pkg/static/**", + "$(PROJECT_DIR)/../../build/ios/pkg/dynamic/", ); + HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = "$(SRCROOT)/App-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", - ../../build/ios/pkg/static, "../../mason_packages/**", ); - OTHER_LDFLAGS = "-ObjC"; + OTHER_LDFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = "com.mapbox.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "1,2"; @@ -616,7 +586,10 @@ isa = XCBuildConfiguration; buildSettings = { BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Mapbox GL Tests.app/Mapbox GL Tests"; - FRAMEWORK_SEARCH_PATHS = ""; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/../../build/ios/pkg/dynamic/", + ); GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", @@ -625,7 +598,6 @@ HEADER_SEARCH_PATHS = ( "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, - "../../build/ios/pkg/static/**", OCMock, OHHTTPStubs/OHHTTPStubs/Sources, ); @@ -651,12 +623,14 @@ isa = XCBuildConfiguration; buildSettings = { BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Mapbox GL Tests.app/Mapbox GL Tests"; - FRAMEWORK_SEARCH_PATHS = ""; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/../../build/ios/pkg/dynamic/", + ); GCC_PREPROCESSOR_DEFINITIONS = "KIF_XCTEST=1"; HEADER_SEARCH_PATHS = ( "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, - "../../build/ios/pkg/static/**", OCMock, OHHTTPStubs/OHHTTPStubs/Sources, ); |