From e49953df1440771b885abb6c86e4d4913a3b005f Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Mon, 3 Dec 2018 20:55:52 -0500 Subject: [ios, build] Replace -symbols with -stripped build flavor --- platform/ios/CHANGELOG.md | 1 + platform/ios/DEVELOPING.md | 8 +++---- platform/ios/INSTALL.md | 12 ++++++++++- platform/ios/Mapbox-iOS-SDK-stripped.podspec | 32 ++++++++++++++++++++++++++++ platform/ios/Mapbox-iOS-SDK-symbols.podspec | 32 ---------------------------- platform/ios/scripts/deploy-packages.sh | 4 ++-- platform/ios/scripts/package.sh | 8 +++++-- platform/ios/scripts/publish.sh | 2 +- 8 files changed, 57 insertions(+), 42 deletions(-) create mode 100644 platform/ios/Mapbox-iOS-SDK-stripped.podspec delete mode 100644 platform/ios/Mapbox-iOS-SDK-symbols.podspec diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 155d34a3a9..f4c59952c8 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -20,6 +20,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT ### Packaging +* Added the `Mapbox-iOS-SDK-stripped` build flavor, featuring fewer debug symbols. Regular framework binaries are no longer stripped of debug symbols and the `Mapbox-iOS-SDK-symbols` build has been retired. ([#13504](https://github.com/mapbox/mapbox-gl-native/pull/13504)) * This SDK’s dynamic framework now has a bundle identifier of `com.mapbox.Mapbox`. ([#12857](https://github.com/mapbox/mapbox-gl-native/pull/12857)) ### Other changes diff --git a/platform/ios/DEVELOPING.md b/platform/ios/DEVELOPING.md index fa23a21f30..e49f1372b7 100644 --- a/platform/ios/DEVELOPING.md +++ b/platform/ios/DEVELOPING.md @@ -20,13 +20,13 @@ Before building, use the scheme picker button in the toolbar to change the schem **iosapp** is only one of several shared schemes. Others include: -* **CI** builds exactly what gets built for continuous integration on Bitrise. -* **bench** is a simple benchmarking application. For more consistent results between runs, run `platform/ios/benchmark/assets/{glyphs,tiles}/download.sh` to download any necessary resources. * **dynamic** builds the SDK as a dynamic framework. * **static** builds the SDK as a static library and separate resource bundle. * **dynamic+static** is a combination of the **dynamic** and **static** schemes. +* **CI** builds exactly what gets built by our continuous integration service. +* **bench** is a simple benchmarking application. For more consistent results between runs, run `platform/ios/benchmark/assets/{glyphs,tiles}/download.sh` to download any necessary resources. -If you don’t have an Apple Developer account, change the destination to a simulator such as “iPhone 6s” before you build and run the app. +If you don’t have an Apple Developer account, change the destination to a simulator before you build and run the app. ### Packaging builds @@ -41,7 +41,7 @@ Build and package the SDK by using the `make iframework` command. You can custom * `BUILDTYPE=Release` will optimize for distribution. Defaults to `Debug`. * `BUILD_DEVICE=false` builds only for the iOS Simulator. * `FORMAT=dynamic` builds only a dynamic framework. `FORMAT=static` builds only a static framework, for legacy compatibility. -* `SYMBOLS=NO` strips the build output of any debug symbols, yielding smaller binaries. Defaults to `YES`. +* `SYMBOLS=NO` strips the build output of debug symbols. Defaults to `YES`. An example command that creates a dynamic framework suitable for eventual App Store distribution: diff --git a/platform/ios/INSTALL.md b/platform/ios/INSTALL.md index a5e59994b7..d7576b68cb 100644 --- a/platform/ios/INSTALL.md +++ b/platform/ios/INSTALL.md @@ -136,9 +136,19 @@ pod 'Mapbox-iOS-SDK-nightly-dynamic', podspec: 'https://raw.githubusercontent.co If using the static framework, add `$(inherited)` to your target’s Other Linker Flags in the Build Settings tab. +##### Using pre-stripped releases with CocoaPods + +If you choose to commit the contents of your `Pods` directory to source control and are encountering file size limitations, you may wish to use builds that have been pre-stripped of debug symbols. + +```rb +pod 'Mapbox-iOS-SDK-stripped', podspec: 'https://raw.githubusercontent.com/mapbox/mapbox-gl-native/ios-v{x.x.x}/platform/ios/Mapbox-iOS-SDK-stripped.podspec' +``` + +Note that these builds lack some debugging information, which could make development more difficult and result in less useful crash reports. Though initially smaller on disk, using these builds has no effect on the ultimate size of your application — see our [Understanding iOS Framework Size guide](https://www.mapbox.com/help/ios-framework-size/) for more information. + #### Carthage -For instructions on installing stable release versions of the Mapbox Maps SDK for iOS with Carthage, see [our website](https://www.mapbox.com/install/ios/carthage/). If you require a build without symbols pre-stripped, use [this feed URL](https://www.mapbox.com/ios-sdk/Mapbox-iOS-SDK-symbols.json) with Carthage. +For instructions on installing stable release versions of the Mapbox Maps SDK for iOS with Carthage, see [our website](https://www.mapbox.com/install/ios/carthage/). If you require a build with debug symbols pre-stripped, use [this feed URL](https://www.mapbox.com/ios-sdk/Mapbox-iOS-SDK-stripped.json) with Carthage. ##### Testing pre-releases with Carthage diff --git a/platform/ios/Mapbox-iOS-SDK-stripped.podspec b/platform/ios/Mapbox-iOS-SDK-stripped.podspec new file mode 100644 index 0000000000..bb2adbf359 --- /dev/null +++ b/platform/ios/Mapbox-iOS-SDK-stripped.podspec @@ -0,0 +1,32 @@ +Pod::Spec.new do |m| + + version = '4.7.0-alpha.3' + + m.name = 'Mapbox-iOS-SDK-stripped' + m.version = "#{version}-stripped" + + m.summary = 'Open source vector map solution for iOS with full styling capabilities.' + m.description = 'Open source, OpenGL-based vector map solution for iOS with full styling capabilities and Cocoa Touch APIs.' + m.homepage = 'https://www.mapbox.com/ios-sdk/' + m.license = { :type => 'BSD', :file => 'LICENSE.md' } + m.author = { 'Mapbox' => 'mobile@mapbox.com' } + m.screenshot = "https://www.mapbox.com/ios-sdk/api/#{version}/img/screenshot.png" + m.social_media_url = 'https://twitter.com/mapbox' + m.documentation_url = 'https://www.mapbox.com/ios-sdk/api/' + + m.source = { + :http => "https://mapbox.s3.amazonaws.com/mapbox-gl-native/ios/builds/mapbox-ios-sdk-#{m.version.to_s}-dynamic.zip", + :flatten => true + } + + m.platform = :ios + m.ios.deployment_target = '9.0' + + m.requires_arc = true + + m.vendored_frameworks = 'dynamic/Mapbox.framework' + m.module_name = 'Mapbox' + + m.preserve_path = '**/*.bcsymbolmap' + +end diff --git a/platform/ios/Mapbox-iOS-SDK-symbols.podspec b/platform/ios/Mapbox-iOS-SDK-symbols.podspec deleted file mode 100644 index 1f69167f97..0000000000 --- a/platform/ios/Mapbox-iOS-SDK-symbols.podspec +++ /dev/null @@ -1,32 +0,0 @@ -Pod::Spec.new do |m| - - version = '4.7.0-alpha.3' - - m.name = 'Mapbox-iOS-SDK-symbols' - m.version = "#{version}-symbols" - - m.summary = 'Open source vector map solution for iOS with full styling capabilities.' - m.description = 'Open source, OpenGL-based vector map solution for iOS with full styling capabilities and Cocoa Touch APIs.' - m.homepage = 'https://www.mapbox.com/ios-sdk/' - m.license = { :type => 'BSD', :file => 'LICENSE.md' } - m.author = { 'Mapbox' => 'mobile@mapbox.com' } - m.screenshot = "https://www.mapbox.com/ios-sdk/api/#{version}/img/screenshot.png" - m.social_media_url = 'https://twitter.com/mapbox' - m.documentation_url = 'https://www.mapbox.com/ios-sdk/api/' - - m.source = { - :http => "https://mapbox.s3.amazonaws.com/mapbox-gl-native/ios/builds/mapbox-ios-sdk-#{m.version.to_s}-dynamic.zip", - :flatten => true - } - - m.platform = :ios - m.ios.deployment_target = '9.0' - - m.requires_arc = true - - m.vendored_frameworks = 'dynamic/Mapbox.framework' - m.module_name = 'Mapbox' - - m.preserve_path = '**/*.bcsymbolmap' - -end diff --git a/platform/ios/scripts/deploy-packages.sh b/platform/ios/scripts/deploy-packages.sh index 01c666db34..d7c000105c 100755 --- a/platform/ios/scripts/deploy-packages.sh +++ b/platform/ios/scripts/deploy-packages.sh @@ -111,7 +111,7 @@ if [[ "${GITHUB_RELEASE}" == true ]]; then --description "${RELEASE_NOTES}" fi -buildPackageStyle "iframework" "symbols-dynamic" -buildPackageStyle "iframework SYMBOLS=NO" "dynamic" +buildPackageStyle "iframework" "dynamic" +buildPackageStyle "iframework SYMBOLS=NO" "stripped-dynamic" step "Finished deploying ${PUBLISH_VERSION} in $(($SECONDS / 60)) minutes and $(($SECONDS % 60)) seconds" diff --git a/platform/ios/scripts/package.sh b/platform/ios/scripts/package.sh index 2506540910..f301c6d55e 100755 --- a/platform/ios/scripts/package.sh +++ b/platform/ios/scripts/package.sh @@ -10,10 +10,14 @@ DERIVED_DATA=build/ios PRODUCTS=${DERIVED_DATA} LOG_PATH=build/xcodebuild-$(date +"%Y-%m-%d_%H%M%S").log -BUILDTYPE=${BUILDTYPE:-Debug} BUILD_FOR_DEVICE=${BUILD_DEVICE:-true} SYMBOLS=${SYMBOLS:-YES} +BUILDTYPE=${BUILDTYPE:-Debug} +if [[ ${SYMBOLS} == YES && ${BUILDTYPE} == Release ]]; then + BUILDTYPE='RelWithDebInfo' +fi + FORMAT=${FORMAT:-dynamic} BUILD_DYNAMIC=true BUILD_STATIC=false @@ -204,7 +208,7 @@ fi function create_podspec { step "Creating local podspec (${1})" - [[ $SYMBOLS = YES ]] && POD_SUFFIX="-symbols" || POD_SUFFIX="" + [[ $SYMBOLS = NO ]] && POD_SUFFIX="-stripped" || POD_SUFFIX="" POD_SOURCE_PATH=' :path => ".",' POD_FRAMEWORKS=" m.vendored_frameworks = '"${NAME}".framework'" INPUT_PODSPEC=platform/ios/${NAME}-iOS-SDK${POD_SUFFIX}.podspec diff --git a/platform/ios/scripts/publish.sh b/platform/ios/scripts/publish.sh index 3212449aa5..4ef0bd49e7 100755 --- a/platform/ios/scripts/publish.sh +++ b/platform/ios/scripts/publish.sh @@ -40,7 +40,7 @@ du -sch dynamic/* # # upload # -PROGRESS= +PROGRESS="" if [ -n "${CI:-}" ]; then PROGRESS="--no-progress" fi -- cgit v1.2.1