summaryrefslogtreecommitdiff
path: root/platform/ios/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'platform/ios/scripts')
-rwxr-xr-xplatform/ios/scripts/check-events-symbols.sh37
-rwxr-xr-xplatform/ios/scripts/deploy-packages.sh112
-rwxr-xr-xplatform/ios/scripts/deploy-snapshot.sh17
-rwxr-xr-xplatform/ios/scripts/deploy-to-cocoapods.sh44
-rwxr-xr-xplatform/ios/scripts/document.sh50
-rwxr-xr-xplatform/ios/scripts/install-packaging-dependencies.sh64
-rwxr-xr-xplatform/ios/scripts/ios-code-coverage.sh31
-rwxr-xr-xplatform/ios/scripts/lint-podspecs.js79
-rwxr-xr-xplatform/ios/scripts/metrics.sh26
-rwxr-xr-xplatform/ios/scripts/package.sh249
-rwxr-xr-xplatform/ios/scripts/publish.sh79
-rw-r--r--platform/ios/scripts/release-notes-github.md.ejs9
-rw-r--r--platform/ios/scripts/release-notes-jazzy.md.ejs23
-rwxr-xr-xplatform/ios/scripts/release-notes.js103
-rwxr-xr-xplatform/ios/scripts/validate-framework-zip.sh131
15 files changed, 0 insertions, 1054 deletions
diff --git a/platform/ios/scripts/check-events-symbols.sh b/platform/ios/scripts/check-events-symbols.sh
deleted file mode 100755
index c76d5e2693..0000000000
--- a/platform/ios/scripts/check-events-symbols.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/usr/bin/env bash
-
-set -eu -o pipefail
-
-function step { >&2 echo -e "\033[1m\033[36m* $@\033[0m"; }
-function finish { >&2 echo -en "\033[0m"; }
-trap finish EXIT
-
-find_framework() {
- step "Looking for Mapbox.framework…"
- echo $( find ./build -name Mapbox | tail -n 1 )
-}
-
-FRAMEWORK=$(find_framework)
-
-if [[ -z "${FRAMEWORK}" || ! -f "${FRAMEWORK}" ]]; then
- echo "No framework found — building dynamic Mapbox.framework…"
- make iframework BUILD_DEVICE=false
- FRAMEWORK=$(find_framework)
-fi
-
-echo "Found framework: ${FRAMEWORK}"
-
-step "Checking for un-namespaced symbols from mapbox-events-ios…"
-
-# Symbols from mapbox-events-ios are prefixed MME. To avoid duplicate symbol
-# warnings when multiple copes of mapbox-events-ios are included in a project,
-# the maps SDK prefixes these symbols with MGL_.
-SYMBOLS=$( nm "$FRAMEWORK" | grep \$_MME || true )
-
-if [ -z "${SYMBOLS}" ]; then
- echo "✅ No un-namespaced symbols found."
-else
- echo "❗️ Found un-namespaced symbols:"
- echo "${SYMBOLS}"
- exit 1
-fi
diff --git a/platform/ios/scripts/deploy-packages.sh b/platform/ios/scripts/deploy-packages.sh
deleted file mode 100755
index b33a25df86..0000000000
--- a/platform/ios/scripts/deploy-packages.sh
+++ /dev/null
@@ -1,112 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-set -o pipefail
-set -u
-
-# dynamic environment variables:
-# VERSION_TAG={determined automatically}: Version tag in format ios-vX.X.X-pre.X
-# GITHUB_RELEASE=true: Upload to github
-
-# environment variables and dependencies:
-# - You must run "mbx auth ..." before running
-# - Set GITHUB_TOKEN to a GitHub API access token in your environment to use GITHUB_RELEASE
-# - The "github-release" command is required to use GITHUB_RELEASE
-
-function step { >&2 echo -e "\033[1m\033[36m* $@\033[0m"; }
-function finish { >&2 echo -en "\033[0m"; }
-trap finish EXIT
-
-buildPackageStyle() {
- local package=$1 style=""
- if [[ ${#} -eq 2 ]]; then
- style="$2"
- fi
- step "Building: make ${package} ${style}"
- make ${package}
- step "Publishing ${package} with ${style}"
- local file_name=""
- if [ -z ${style} ]
- then
- ./platform/ios/scripts/publish.sh "${PUBLISH_VERSION}"
- file_name=mapbox-ios-sdk-${PUBLISH_VERSION}.zip
- else
- ./platform/ios/scripts/publish.sh "${PUBLISH_VERSION}" ${style}
- file_name=mapbox-ios-sdk-${PUBLISH_VERSION}-${style}.zip
- fi
- if [[ "${GITHUB_RELEASE}" == true ]]; then
- step "Uploading ${file_name} to GitHub"
- github-release upload \
- --tag "ios-v${PUBLISH_VERSION}" \
- --name ${file_name} \
- --file "${BINARY_DIRECTORY}/${file_name}" > /dev/null
- fi
-}
-
-export TRAVIS_REPO_SLUG=mapbox-gl-native
-export GITHUB_USER=mapbox
-export GITHUB_REPO=mapbox-gl-native
-export BUILDTYPE=Release
-
-VERSION_TAG=${VERSION_TAG:-''}
-PUBLISH_VERSION=
-BINARY_DIRECTORY='build/ios'
-GITHUB_RELEASE=${GITHUB_RELEASE:-true}
-PUBLISH_PRE_FLAG=''
-
-if [[ -z `which github-release` ]]; then
- step "Installing github-release…"
- brew install github-release
- if [ -z `which github-release` ]; then
- echo "Unable to install github-release. See: https://github.com/aktau/github-release"
- exit 1
- fi
-fi
-
-if [[ ${GITHUB_RELEASE} = "true" ]]; then
- GITHUB_RELEASE=true # Assign bool, not just a string
-fi
-
-if [[ -z ${VERSION_TAG} ]]; then
- step "Determining version number from most recent relevant git tag…"
- VERSION_TAG=$( git describe --tags --match=ios-v*.*.* --abbrev=0 )
- echo "Found tag: ${VERSION_TAG}"
-fi
-
-if [[ $( echo ${VERSION_TAG} | grep --invert-match ios-v ) ]]; then
- echo "Error: ${VERSION_TAG} is not a valid iOS version tag"
- echo "VERSION_TAG should be in format: ios-vX.X.X-pre.X"
- exit 1
-fi
-
-if github-release info --tag ${VERSION_TAG} | grep --quiet "draft: ✗"; then
- echo "Error: ${VERSION_TAG} has already been published on GitHub"
- echo "See: https://github.com/${GITHUB_USER}/${GITHUB_REPO}/releases/tag/${VERSION_TAG}"
- exit 1
-fi
-
-PUBLISH_VERSION=$( echo ${VERSION_TAG} | sed 's/^ios-v//' )
-git checkout ${VERSION_TAG}
-
-step "Deploying version ${PUBLISH_VERSION}…"
-
-npm install --ignore-scripts
-mkdir -p ${BINARY_DIRECTORY}
-
-if [[ "${GITHUB_RELEASE}" == true ]]; then
- step "Create GitHub release…"
- if [[ $( echo ${PUBLISH_VERSION} | awk '/[0-9]-/' ) ]]; then
- PUBLISH_PRE_FLAG='--pre-release'
- fi
- RELEASE_NOTES=$( ./platform/ios/scripts/release-notes.js github )
- github-release release \
- --tag "ios-v${PUBLISH_VERSION}" \
- --name "ios-v${PUBLISH_VERSION}" \
- --draft ${PUBLISH_PRE_FLAG} \
- --description "${RELEASE_NOTES}"
-fi
-
-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/deploy-snapshot.sh b/platform/ios/scripts/deploy-snapshot.sh
deleted file mode 100755
index d0d5d59d2e..0000000000
--- a/platform/ios/scripts/deploy-snapshot.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env bash
-
-set -euo pipefail
-
-function step { >&2 echo -e "\033[1m\033[36m* $@\033[0m"; }
-function finish { >&2 echo -en "\033[0m"; }
-trap finish EXIT
-
-DATE=`date +%Y-%m-%d`
-PROJ_VERSION=$(git rev-list --count HEAD)
-SNAPSHOT_TYPE="snapshot-dynamic"
-
-step "Uploading ${SNAPSHOT_TYPE} build for ${DATE}-${PROJ_VERSION} to s3…"
-
-./platform/ios/scripts/publish.sh "${SNAPSHOT_TYPE}" "${DATE}-${PROJ_VERSION}"
-
-step "Finished deploying ${SNAPSHOT_TYPE} build in $(($SECONDS / 60)) minutes and $(($SECONDS % 60)) seconds"
diff --git a/platform/ios/scripts/deploy-to-cocoapods.sh b/platform/ios/scripts/deploy-to-cocoapods.sh
deleted file mode 100755
index 27eb1fbabe..0000000000
--- a/platform/ios/scripts/deploy-to-cocoapods.sh
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/env bash
-
-# This relies on either:
-# 1. You being authenticated locally with CocoaPods trunk.
-# 2. The `COCOAPODS_TRUNK_TOKEN` environment variable being set.
-
-set -euo pipefail
-
-function step { >&2 echo -e "\033[1m\033[36m* $@\033[0m"; }
-function finish { >&2 echo -en "\033[0m"; }
-trap finish EXIT
-
-CIRCLE_TAG=${CIRCLE_TAG:-""}
-
-step "Pushing release to CocoaPods trunk…"
-
-if [[ $CIRCLE_TAG ]]; then
- pod trunk push platform/ios/Mapbox-iOS-SDK.podspec --allow-warnings
-else
- echo "Skipping push to CocoaPods trunk for untagged build"
-fi
-
-step "Pushing release/builds to Mapbox podspecs repo…"
-
-if [[ -z $(pod repo list | grep -i mapbox-public) ]]; then
- pod repo add mapbox-public https://github.com/mapbox/pod-specs
-else
- echo "Found existing mapbox-public podspecs repo"
-fi
-
-if [[ -z $(git config --global user.email) && $CI ]]; then
- echo "Setting machine user as git committer"
- git config --global user.email "MapboxCI@users.noreply.github.com"
-fi
-
-if [[ $CIRCLE_TAG ]]; then
- pod repo push mapbox-public platform/ios/Mapbox-iOS-SDK.podspec --allow-warnings
- pod repo push mapbox-public platform/ios/Mapbox-iOS-SDK-stripped.podspec --allow-warnings
-else
- echo "Skipping push of release podspecs to mapbox-public for untagged build"
-
- # pod repo push mapbox-public platform/ios/Mapbox-iOS-SDK-snapshot-dynamic.podspec --allow-warnings
- echo "Skipping push of snapshot to mapbox-public until we have a way to update the versions in the snapshot podspec"
-fi
diff --git a/platform/ios/scripts/document.sh b/platform/ios/scripts/document.sh
deleted file mode 100755
index bb1c63dc6c..0000000000
--- a/platform/ios/scripts/document.sh
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/env bash
-
-set -euo pipefail
-
-function step { >&2 echo -e "\033[1m\033[36m* $@\033[0m"; }
-function finish { >&2 echo -en "\033[0m"; }
-trap finish EXIT
-
-if [ -z `which jazzy` ]; then
- ./platform/ios/scripts/install-packaging-dependencies.sh
-fi
-
-DEFAULT_THEME="platform/darwin/docs/theme"
-THEME=${JAZZY_THEME:-$DEFAULT_THEME}
-CUSTOM_HEAD=${JAZZY_CUSTOM_HEAD:-''}
-OUTPUT=${OUTPUT:-documentation}
-
-BRANCH=$( git describe --tags --match=ios-v*.*.* --abbrev=0 )
-SHORT_VERSION=$( echo ${BRANCH} | sed 's/^ios-v//' )
-RELEASE_VERSION=$( echo ${SHORT_VERSION} | sed -e 's/^ios-v//' -e 's/-.*//' )
-
-rm -rf /tmp/mbgl
-mkdir -p /tmp/mbgl/
-
-step "Generating readme and release notes"
-README=/tmp/mbgl/README.md
-npm install --ignore-scripts
-node platform/ios/scripts/release-notes.js jazzy >> "${README}"
-
-rm -rf ${OUTPUT}
-mkdir -p ${OUTPUT}
-
-cp -r platform/darwin/docs/img "${OUTPUT}"
-cp -r platform/ios/docs/img "${OUTPUT}"
-
-step "Generating jazzy docs for ${SHORT_VERSION}…"
-
-jazzy \
- --config platform/ios/jazzy.yml \
- --sdk iphonesimulator \
- --github-file-prefix https://github.com/mapbox/mapbox-gl-native/tree/${BRANCH} \
- --module-version ${SHORT_VERSION} \
- --readme ${README} \
- --documentation="platform/{darwin,ios}/docs/guides/*.md" \
- --root-url https://docs.mapbox.com/ios/api/maps/${RELEASE_VERSION}/ \
- --theme ${THEME} \
- --head "${CUSTOM_HEAD}" \
- --output ${OUTPUT} \
- --title "Maps SDK for iOS" \
- --module-version ${SHORT_VERSION}
diff --git a/platform/ios/scripts/install-packaging-dependencies.sh b/platform/ios/scripts/install-packaging-dependencies.sh
deleted file mode 100755
index 558223bad4..0000000000
--- a/platform/ios/scripts/install-packaging-dependencies.sh
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/env bash
-
-set -euo pipefail
-
-COCOAPODS_VERSION="1.7.5"
-JAZZY_VERSION="0.11.1"
-CIRCLECI=${CIRCLECI:-false}
-
-function step { >&2 echo -e "\033[1m\033[36m* $@\033[0m"; }
-function finish { >&2 echo -en "\033[0m"; }
-trap finish EXIT
-
-step "Installing packaging dependencies…"
-
-##
-## aws
-##
-if [ -z `which aws` ]; then
- brew install awscli
-else
- echo "Found awscli"
-fi
-
-##
-## cocoapods
-##
-if [[ -z `which pod` || $(pod --version) != "${COCOAPODS_VERSION}" ]]; then
- step "Installing cocoapods…"
-
- if [[ "${CIRCLECI}" == true ]]; then
- sudo gem install cocoapods -v $COCOAPODS_VERSION --no-document
- else
- gem install cocoapods -v $COCOAPODS_VERSION --no-document
- fi
-
- if [ -z `which pod` ]; then
- echo "Unable to install cocoapods ($COCOAPODS_VERSION)."
- exit 1
- fi
-else
- echo "Found cocoapods (${COCOAPODS_VERSION})"
-fi
-
-##
-## jazzy
-##
-if [[ -z `which jazzy` || $(jazzy -v) != "jazzy version: ${JAZZY_VERSION}" ]]; then
- step "Installing jazzy…"
-
- if [[ "${CIRCLECI}" == true ]]; then
- sudo gem install jazzy -v $JAZZY_VERSION --no-document
- else
- gem install jazzy -v $JAZZY_VERSION --no-document
- fi
-
- if [ -z `which jazzy` ]; then
- echo "Unable to install jazzy ($JAZZY_VERSION). See https://github.com/mapbox/mapbox-gl-native/blob/master/platform/ios/INSTALL.md"
- exit 1
- fi
-else
- echo "Found jazzy (${JAZZY_VERSION})"
-fi
-
-step "Finished installing packaging dependencies"
diff --git a/platform/ios/scripts/ios-code-coverage.sh b/platform/ios/scripts/ios-code-coverage.sh
deleted file mode 100755
index 8b8adb423a..0000000000
--- a/platform/ios/scripts/ios-code-coverage.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-set -o pipefail
-
-#
-# Get code coverage report, then convert it to JSON.
-# The coverage reports end up in different locations based on whether coverage
-# is generated via CI or locally.
-#
-cov_result="";
-if [ -f build/ios/Logs/Test/*.xcresult/*_Test/*.xccovreport ]; then
- cov_result=build/ios/Logs/Test/*.xcresult/*_Test/*.xccovreport
-elif [ -f build/ios/ios/Logs/Test/*.xcresult/*_Test/*.xccovreport ]; then
- cov_result=build/ios/ios/Logs/Test/*.xcresult/*_Test/*.xccovreport
-else
- echo "Coverage file does not exist. Please run tests before executing"
- exit 1
-fi
-
-xcrun xccov view $cov_result --json > output.json
-
-#
-# Convert the line coverage for the dynamic target to a percentage. Currently,
-# only CI tests are included when calculated code coverage.
-#
-percentage=`node -e "console.log(require('./output.json').lineCoverage)"`
-cov=$(printf "%.2f" $(echo "$percentage*100" | bc -l))
-
-# Generate a formatted JSON file and upload it to S3.
-./././scripts/code-coverage.sh $cov "iOS" "$1"
diff --git a/platform/ios/scripts/lint-podspecs.js b/platform/ios/scripts/lint-podspecs.js
deleted file mode 100755
index 1381acacff..0000000000
--- a/platform/ios/scripts/lint-podspecs.js
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/usr/bin/env node
-
-const fs = require('fs');
-const execSync = require('child_process').execSync;
-const _ = require('lodash');
-const semver = require('semver');
-
-console.step = _.partial(console.log, '\n\033[1m\033[36m*', _, '\033[0m');
-process.exitCode = 0;
-
-const podspecsPath = 'platform/ios';
-
-/*
- Step 1. Run the official CocoaPods linter against all of our podspecs.
-*/
-console.step(`Running CocoaPods linter against podspecs in '${podspecsPath}'`)
-execSync(`pod spec lint ${podspecsPath}/*.podspec --quick`, {stdio: 'inherit'});
-
-/*
- Step 2. Check that our podspecs contain properly formatted version strings.
-*/
-console.step('Checking Mapbox SDK version strings in podspecs')
-const podspecs = fs.readdirSync(podspecsPath).filter(fn => fn.endsWith('.podspec'));
-
-let matchedVersions = [];
-
-for (const podspecFilename of podspecs) {
- console.log(podspecFilename);
- const podspecContents = fs.readFileSync(`${podspecsPath}/${podspecFilename}`, 'utf8');
-
- /*
- This regular expression:
- - Matches single lines in the format: version = '9.9.9'
- - Groups the version number inside the single quotes.
- - Ignores whitespace at the start of the line and between parts of the definition using: \s*?
- */
- const regex = /^\s*?version\s*?=\s*?'(.*)'$/gmi;
-
- const match = regex.exec(podspecContents);
- if (!match) {
- console.error(' ❌ No version string found');
- process.exitCode = 1;
- continue;
- }
-
- const matchedVersion = match[1];
- matchedVersions.push(matchedVersion);
-
- if (!semver.valid(matchedVersion)) {
- console.error(` ❌ ${matchedVersion} is not a valid semantic version`);
- process.exitCode = 1;
- continue;
- }
-
- console.log(` ✅ ${matchedVersion} is a valid semantic version`);
-}
-
-/*
- Step 3. Check that versions are consistent across our podspecs.
-*/
-console.step('Checking version consistency')
-const uniqueVersions = _.uniq(matchedVersions);
-if (uniqueVersions.length != 1) {
- console.error('❌ Versions in podspecs do not match:', uniqueVersions);
- process.exitCode = 1;
-} else {
- console.log(`✅ ${uniqueVersions[0]} is set in all podspecs`);
-}
-
-/*
- Step 4. Finish up and summarize the results.
-*/
-process.on('exit', (code) => {
- if (code == 0) {
- console.log('\nPodspec linting completed successfully! 🕵️‍♀️');
- } else {
- console.log('\nPodspec linting failed. 💥');
- }
-});
diff --git a/platform/ios/scripts/metrics.sh b/platform/ios/scripts/metrics.sh
deleted file mode 100755
index 080dce7427..0000000000
--- a/platform/ios/scripts/metrics.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-set -o pipefail
-
-# Generate stripped versions for every architecture
-xcrun bitcode_strip build/ios/pkg/dynamic/Mapbox.framework/Mapbox -r -o build/ios/pkg/dynamic/Mapbox-stripped
-strip -Sx build/ios/pkg/dynamic/Mapbox-stripped
-lipo build/ios/pkg/dynamic/Mapbox-stripped -extract armv7 -output build/ios/pkg/dynamic/Mapbox-stripped-armv7
-lipo build/ios/pkg/dynamic/Mapbox-stripped -extract arm64 -output build/ios/pkg/dynamic/Mapbox-stripped-arm64
-lipo build/ios/pkg/dynamic/Mapbox-stripped -extract x86_64 -output build/ios/pkg/dynamic/Mapbox-stripped-x86_64
-
-# Track individual architectures
-scripts/check_binary_size.js "build/ios/pkg/dynamic/Mapbox-stripped-armv7" "iOS armv7"
-scripts/check_binary_size.js "build/ios/pkg/dynamic/Mapbox-stripped-arm64" "iOS arm64"
-scripts/check_binary_size.js "build/ios/pkg/dynamic/Mapbox-stripped-x86_64" "iOS x86_64"
-
-# Track overall library size
-scripts/check_binary_size.js "build/ios/pkg/dynamic/Mapbox-stripped" "iOS Dynamic"
-
-if [[ $CIRCLE_BRANCH == master ]]; then
- # Build source data for http://mapbox.github.io/mapbox-gl-native/metrics/binary-size/
- # and log binary sizes to metrics warehouse
- scripts/publish_binary_size.js
-fi
-
diff --git a/platform/ios/scripts/package.sh b/platform/ios/scripts/package.sh
deleted file mode 100755
index 5475632c24..0000000000
--- a/platform/ios/scripts/package.sh
+++ /dev/null
@@ -1,249 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-set -o pipefail
-set -u
-
-NAME=Mapbox
-OUTPUT=build/ios/pkg
-DERIVED_DATA=build/ios
-PRODUCTS=${DERIVED_DATA}
-LOG_PATH=build/xcodebuild-$(date +"%Y-%m-%d_%H%M%S").log
-
-BUILD_FOR_DEVICE=${BUILD_DEVICE:-true}
-BUILD_DOCS=${BUILD_DOCS:-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
-if [[ ${FORMAT} == "static" ]]; then
- BUILD_STATIC=true
- BUILD_DYNAMIC=false
-elif [[ ${FORMAT} != "dynamic" ]]; then
- echo "Error: FORMAT must be dynamic or static."
- exit 1
-fi
-
-SDK=iphonesimulator
-if [[ ${BUILD_FOR_DEVICE} == true ]]; then
- SDK=iphoneos
-fi
-IOS_SDK_VERSION=`xcrun --sdk ${SDK} --show-sdk-version`
-
-function step { >&2 echo -e "\033[1m\033[36m* $@\033[0m"; }
-function finish { >&2 echo -en "\033[0m"; }
-trap finish EXIT
-
-step "Configuring ${FORMAT} framework for ${SDK} ${IOS_SDK_VERSION} (symbols: ${SYMBOLS}, buildtype: ${BUILDTYPE})"
-
-xcodebuild -version
-
-rm -rf ${OUTPUT}
-if [[ ${BUILD_STATIC} == true ]]; then
- mkdir -p "${OUTPUT}"/static
-fi
-if [[ ${BUILD_DYNAMIC} == true ]]; then
- mkdir -p "${OUTPUT}"/dynamic
-fi
-
-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 "
-echo ${HASH}
-echo ${HASH} >> ${VERSION}
-
-PROJ_VERSION=$(git rev-list --count HEAD)
-SEM_VERSION=$( git describe --tags --match=ios-v*.*.* --abbrev=0 | sed 's/^ios-v//' )
-SHORT_VERSION=${SEM_VERSION%-*}
-
-step "Building targets (build ${PROJ_VERSION}, version ${SEM_VERSION})"
-
-SCHEME='dynamic'
-if [[ ${BUILD_STATIC} == true ]]; then
- SCHEME='static'
-fi
-
-CI_XCCONFIG=''
-if [[ ! -z "${CI:=}" ]]; then
- xcconfig='platform/darwin/ci.xcconfig'
- echo "CI environment, using ${xcconfig}"
- CI_XCCONFIG="-xcconfig ./${xcconfig}"
-fi
-
-step "Building ${FORMAT} framework for iOS Simulator using ${SCHEME} scheme"
-xcodebuild \
- CURRENT_PROJECT_VERSION=${PROJ_VERSION} \
- CURRENT_SHORT_VERSION=${SHORT_VERSION} \
- CURRENT_SEMANTIC_VERSION=${SEM_VERSION} \
- CURRENT_COMMIT_HASH=${HASH} \
- ONLY_ACTIVE_ARCH=NO \
- ${CI_XCCONFIG} \
- -derivedDataPath ${DERIVED_DATA} \
- -workspace ./platform/ios/ios.xcworkspace \
- -scheme ${SCHEME} \
- -configuration ${BUILDTYPE} \
- -sdk iphonesimulator \
- -jobs ${JOBS} | tee ${LOG_PATH} | xcpretty
-
-if [[ ${BUILD_FOR_DEVICE} == true ]]; then
- step "Building ${FORMAT} framework for iOS devices using ${SCHEME} scheme"
- xcodebuild \
- CURRENT_PROJECT_VERSION=${PROJ_VERSION} \
- CURRENT_SHORT_VERSION=${SHORT_VERSION} \
- CURRENT_SEMANTIC_VERSION=${SEM_VERSION} \
- CURRENT_COMMIT_HASH=${HASH} \
- ONLY_ACTIVE_ARCH=NO \
- ${CI_XCCONFIG} \
- -derivedDataPath ${DERIVED_DATA} \
- -workspace ./platform/ios/ios.xcworkspace \
- -scheme ${SCHEME} \
- -configuration ${BUILDTYPE} \
- -sdk iphoneos \
- -jobs ${JOBS} | tee ${LOG_PATH} | xcpretty
-fi
-
-LIBS=(Mapbox.a)
-
-# https://medium.com/@syshen/create-an-ios-universal-framework-148eb130a46c
-if [[ ${BUILD_FOR_DEVICE} == true ]]; then
- if [[ ${BUILD_STATIC} == true ]]; then
- step "Assembling static framework for iOS Simulator and devices…"
- mkdir -p ${OUTPUT}/static/${NAME}.framework
- libtool -static -no_warning_for_no_symbols \
- -o ${OUTPUT}/static/${NAME}.framework/${NAME} \
- ${LIBS[@]/#/${PRODUCTS}/${BUILDTYPE}-iphoneos/lib} \
- ${LIBS[@]/#/${PRODUCTS}/${BUILDTYPE}-iphonesimulator/lib} \
- `cmake -LA -N ${DERIVED_DATA} | grep MASON_PACKAGE_icu_LIBRARIES | cut -d= -f2`
-
- cp -rv ${PRODUCTS}/${BUILDTYPE}-iphoneos/${NAME}.bundle ${OUTPUT}/static
- fi
-
- if [[ ${BUILD_DYNAMIC} == true ]]; then
- step "Copying dynamic framework into place for iOS devices"
- cp -r \
- ${PRODUCTS}/${BUILDTYPE}-iphoneos/${NAME}.framework \
- ${OUTPUT}/dynamic/
-
- if [[ -e ${PRODUCTS}/${BUILDTYPE}-iphoneos/${NAME}.framework.dSYM ]]; then
- step "Copying dSYM"
- cp -r ${PRODUCTS}/${BUILDTYPE}-iphoneos/${NAME}.framework.dSYM \
- ${OUTPUT}/dynamic/
- if [[ -e ${PRODUCTS}/${BUILDTYPE}-iphonesimulator/${NAME}.framework.dSYM ]]; then
- step "Merging device and simulator dSYMs…"
- lipo \
- ${PRODUCTS}/${BUILDTYPE}-iphoneos/${NAME}.framework.dSYM/Contents/Resources/DWARF/${NAME} \
- ${PRODUCTS}/${BUILDTYPE}-iphonesimulator/${NAME}.framework.dSYM/Contents/Resources/DWARF/${NAME} \
- -create -output ${OUTPUT}/dynamic/${NAME}.framework.dSYM/Contents/Resources/DWARF/${NAME}
- lipo -info ${OUTPUT}/dynamic/${NAME}.framework.dSYM/Contents/Resources/DWARF/${NAME}
- fi
- fi
-
- step "Merging simulator dynamic library into device dynamic library…"
- lipo \
- ${PRODUCTS}/${BUILDTYPE}-iphoneos/${NAME}.framework/${NAME} \
- ${PRODUCTS}/${BUILDTYPE}-iphonesimulator/${NAME}.framework/${NAME} \
- -create -output ${OUTPUT}/dynamic/${NAME}.framework/${NAME} | echo
- fi
-
- cp -rv platform/ios/app/Settings.bundle ${OUTPUT}
-else
- if [[ ${BUILD_STATIC} == true ]]; then
- step "Assembling static library for iOS Simulator…"
- mkdir -p ${OUTPUT}/static/${NAME}.framework
- libtool -static -no_warning_for_no_symbols \
- -o ${OUTPUT}/static/${NAME}.framework/${NAME} \
- ${LIBS[@]/#/${PRODUCTS}/${BUILDTYPE}-iphonesimulator/lib} \
- `cmake -LA -N ${DERIVED_DATA} | grep MASON_PACKAGE_icu_LIBRARIES | cut -d= -f2`
-
- cp -rv ${PRODUCTS}/${BUILDTYPE}-iphonesimulator/${NAME}.bundle ${OUTPUT}/static
- fi
-
- if [[ ${BUILD_DYNAMIC} == true ]]; then
- step "Copying dynamic framework into place for iOS Simulator…"
- cp -r \
- ${PRODUCTS}/${BUILDTYPE}-iphonesimulator/${NAME}.framework \
- ${OUTPUT}/dynamic/${NAME}.framework
- if [[ -e ${PRODUCTS}/${BUILDTYPE}-iphonesimulator/${NAME}.framework.dSYM ]]; then
- step "Copying dSYM"
- cp -r ${PRODUCTS}/${BUILDTYPE}-iphonesimulator/${NAME}.framework.dSYM \
- ${OUTPUT}/dynamic/
- fi
- fi
-
- cp -rv platform/ios/app/Settings.bundle ${OUTPUT}
-fi
-
-function get_comparable_uuid {
- echo $(dwarfdump --uuid ${1} | sed -n 's/.*UUID:\([^\"]*\) .*/\1/p' | sort)
-}
-
-function validate_dsym {
- step "Validating dSYM and framework UUIDs…"
- DSYM_UUID=$(get_comparable_uuid "${1}")
- FRAMEWORK_UUID=$(get_comparable_uuid "${2}")
- echo -e "${1}\n ${DSYM_UUID}\n${2}\n ${FRAMEWORK_UUID}"
- if [[ ${DSYM_UUID} != ${FRAMEWORK_UUID} ]]; then
- echo "Error: dSYM and framework UUIDs do not match."
- exit 1
- fi
-}
-
-if [[ ${BUILD_DYNAMIC} == true && ${BUILDTYPE} == Release ]]; then
- validate_dsym \
- "${OUTPUT}/dynamic/${NAME}.framework.dSYM/Contents/Resources/DWARF/${NAME}" \
- "${OUTPUT}/dynamic/${NAME}.framework/${NAME}"
-
- step "Removing i386 slice from dSYM"
- lipo -remove i386 "${OUTPUT}/dynamic/${NAME}.framework.dSYM/Contents/Resources/DWARF/${NAME}" -o "${OUTPUT}/dynamic/${NAME}.framework.dSYM/Contents/Resources/DWARF/${NAME}"
- lipo -info "${OUTPUT}/dynamic/${NAME}.framework.dSYM/Contents/Resources/DWARF/${NAME}"
-fi
-
-if [[ ${BUILD_STATIC} == true ]]; then
- step "Copying static library headers…"
- cp -rv "${PRODUCTS}/${BUILDTYPE}-iphoneos/Headers" "${OUTPUT}/static/${NAME}.framework/Headers"
- cat platform/ios/framework/Mapbox-static.h > "${OUTPUT}/static/${NAME}.framework/Headers/Mapbox.h"
- cat "${PRODUCTS}/${BUILDTYPE}-iphoneos/Headers/Mapbox.h" >> "${OUTPUT}/static/${NAME}.framework/Headers/Mapbox.h"
-fi
-
-step "Copying library resources…"
-cp -pv LICENSE.md ${OUTPUT}
-if [[ ${BUILD_STATIC} == true ]]; then
- cp -pv "${OUTPUT}/static/${NAME}.bundle/Info.plist" "${OUTPUT}/static/${NAME}.framework/Info.plist"
- plutil -replace CFBundlePackageType -string FMWK "${OUTPUT}/static/${NAME}.framework/Info.plist"
- mkdir "${OUTPUT}/static/${NAME}.framework/Modules"
- cp -pv platform/ios/framework/modulemap "${OUTPUT}/static/${NAME}.framework/Modules/module.modulemap"
-fi
-if [[ ${BUILD_DYNAMIC} == true && ${BUILD_FOR_DEVICE} == true ]]; then
- step "Copying bitcode symbol maps…"
- find "${PRODUCTS}/${BUILDTYPE}-iphoneos" -name '*.bcsymbolmap' -type f -exec cp -pv {} "${OUTPUT}/dynamic/" \;
-fi
-sed -n -e '/^## /,$p' platform/ios/CHANGELOG.md > "${OUTPUT}/CHANGELOG.md"
-
-rm -rf /tmp/mbgl
-mkdir -p /tmp/mbgl/
-README=/tmp/mbgl/README.md
-cp platform/ios/docs/pod-README.md "${README}"
-if [[ ${BUILD_DYNAMIC} == false ]]; then
- sed -i '' -e '/{{DYNAMIC}}/,/{{\/DYNAMIC}}/d' "${README}"
-fi
-if [[ ${BUILD_STATIC} == false ]]; then
- sed -i '' -e '/{{STATIC}}/,/{{\/STATIC}}/d' "${README}"
-fi
-sed -i '' \
- -e '/{{DYNAMIC}}/d' -e '/{{\/DYNAMIC}}/d' \
- -e '/{{STATIC}}/d' -e '/{{\/STATIC}}/d' \
- "${README}"
-cp ${README} "${OUTPUT}"
-
-if [ ${BUILD_DOCS} == true ]; then
- step "Generating API documentation for ${BUILDTYPE} Build…"
- make idocument OUTPUT="${OUTPUT}/documentation"
-fi
diff --git a/platform/ios/scripts/publish.sh b/platform/ios/scripts/publish.sh
deleted file mode 100755
index 1a4652a509..0000000000
--- a/platform/ios/scripts/publish.sh
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/usr/bin/env bash
-
-set -euo pipefail
-
-function step { >&2 echo -e "\033[1m\033[36m* $@\033[0m"; }
-function finish { >&2 echo -en "\033[0m"; }
-trap finish EXIT
-
-#
-# iOS release tag format is `vX.Y.Z`; `X.Y.Z` gets passed in
-# In the case of stripped builds, we also append the `-stripped`.
-#
-PUBLISH_VERSION="$1"
-
-if [[ ${#} -eq 2 ]]; then
- PUBLISH_STYLE="-$2"
-else
- PUBLISH_STYLE=""
-fi
-
-GITHUB_REPO=${GITHUB_REPO:-'mapbox-gl-native'}
-
-#
-# zip
-#
-cd build/ios/pkg
-ZIP_FILENAME="mapbox-ios-sdk-${PUBLISH_VERSION}${PUBLISH_STYLE}.zip"
-step "Compressing ${ZIP_FILENAME}…"
-rm -f ../${ZIP_FILENAME}
-zip -yr ../${ZIP_FILENAME} *
-cd ..
-
-#
-# report file sizes
-#
-step "Echoing file sizes…"
-du -sh ${ZIP_FILENAME}
-du -sch pkg/*
-du -sch pkg/dynamic/*
-
-#
-# upload
-#
-PROGRESS=""
-if [ -n "${CI:-}" ]; then
- PROGRESS="--no-progress"
-fi
-
-step "Uploading ${ZIP_FILENAME} to s3…"
-aws s3 cp ${ZIP_FILENAME} s3://mapbox/${GITHUB_REPO}/ios/builds/ --acl public-read ${PROGRESS}
-S3_URL=https://mapbox.s3.amazonaws.com/${GITHUB_REPO}/ios/builds/${ZIP_FILENAME}
-echo "URL: ${S3_URL}"
-
-#
-# upload & update snapshot
-#
-if [[ ${PUBLISH_VERSION} =~ "snapshot" ]]; then
- step "Updating ${PUBLISH_VERSION} to ${PUBLISH_STYLE}…"
- GENERIC_ZIP_FILENAME="mapbox-ios-sdk-${PUBLISH_VERSION}.zip"
- aws s3 cp \
- s3://mapbox/$GITHUB_REPO/ios/builds/${ZIP_FILENAME} \
- s3://mapbox/$GITHUB_REPO/ios/builds/${GENERIC_ZIP_FILENAME} --acl public-read ${PROGRESS}
-fi
-
-#
-# verify upload integrity
-#
-
-step "Validating local and remote checksums…"
-curl --output remote-${ZIP_FILENAME} ${S3_URL}
-LOCAL_CHECKSUM=$( shasum -a 256 -b ${ZIP_FILENAME} | cut -d ' ' -f 1 )
-REMOTE_CHECKSUM=$( shasum -a 256 -b remote-${ZIP_FILENAME} | cut -d ' ' -f 1 )
-
-if [ "${LOCAL_CHECKSUM}" == "${REMOTE_CHECKSUM}" ]; then
- echo "Checksums match: ${LOCAL_CHECKSUM}"
-else
- echo "Checksums did not match: ${LOCAL_CHECKSUM} != ${REMOTE_CHECKSUM}"
- exit 1
-fi
diff --git a/platform/ios/scripts/release-notes-github.md.ejs b/platform/ios/scripts/release-notes-github.md.ejs
deleted file mode 100644
index 53c7c842fe..0000000000
--- a/platform/ios/scripts/release-notes-github.md.ejs
+++ /dev/null
@@ -1,9 +0,0 @@
-[Changes](https://github.com/mapbox/mapbox-gl-native/compare/ios-v<%-PREVIOUSVERSION%>...ios-v<%-CURRENTVERSION%>) since [Mapbox Maps SDK for iOS v<%-PREVIOUSVERSION%>](https://github.com/mapbox/mapbox-gl-native/releases/tag/ios-v<%-PREVIOUSVERSION%>):
-
-<%-CHANGELOG-%>
-
-<% if (isPrerelease) { %>
-To install this pre-release via a dependency manager, see our [CocoaPods](https://github.com/mapbox/mapbox-gl-native/blob/ios-v<%-CURRENTVERSION%>/platform/ios/INSTALL.md#CocoaPods) or [Carthage](https://github.com/mapbox/mapbox-gl-native/blob/ios-v<%-CURRENTVERSION%>/platform/ios/INSTALL.md#Carthage) instructions.
-<% } -%>
-
-Documentation is [available online](https://www.mapbox.com/ios-sdk/api/<%-CURRENTVERSION%>/) or as part of the download.
diff --git a/platform/ios/scripts/release-notes-jazzy.md.ejs b/platform/ios/scripts/release-notes-jazzy.md.ejs
deleted file mode 100644
index 12b7480a2b..0000000000
--- a/platform/ios/scripts/release-notes-jazzy.md.ejs
+++ /dev/null
@@ -1,23 +0,0 @@
-# [Mapbox Maps SDK for iOS](https://www.mapbox.com/ios-sdk/)
-
-The Mapbox Maps SDK for iOS is an open-source framework for embedding interactive map views with scalable, customizable vector maps into Cocoa Touch applications on iOS 9.0 and above using Objective-C, Swift, or Interface Builder. It takes stylesheets that conform to the [Mapbox Style Specification](https://www.mapbox.com/mapbox-gl-style-spec/), applies them to vector tiles that conform to the [Mapbox Vector Tile Specification](https://www.mapbox.com/developers/vector-tiles/), and renders them using OpenGL.
-
-![Mapbox Maps SDK for iOS screenshots](img/screenshot.png)
-
-For setup information, check out the [Mapbox Maps SDK for iOS homepage](https://www.mapbox.com/ios-sdk/). For detailed usage instructions, read “[First steps with the Mapbox Maps SDK for iOS](https://www.mapbox.com/help/first-steps-ios-sdk/)” and consult the [online examples](https://www.mapbox.com/ios-sdk/examples/).
-
-If you have any questions, please see [our help page](https://www.mapbox.com/help/). We welcome your [bug reports, feature requests, and contributions](https://github.com/mapbox/mapbox-gl-native/issues/).
-
-## Changes in version <%-CURRENTVERSION%>
-
-<%-CURRENTCHANGELOG%>
-
-## Recent changes
-
-<% OTHERRELEASES.forEach(function(release) { %>
-### <%-release.version%>
-
-<%-release.changelog%>
-<% }) -%>
-
-See the [full changelog](https://github.com/mapbox/mapbox-gl-native/blob/ios-v<%-CURRENTVERSION%>/platform/ios/CHANGELOG.md) for previous releases.
diff --git a/platform/ios/scripts/release-notes.js b/platform/ios/scripts/release-notes.js
deleted file mode 100755
index 41caff7fa4..0000000000
--- a/platform/ios/scripts/release-notes.js
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/usr/bin/env node
-
-const fs = require('fs');
-const execSync = require('child_process').execSync;
-const ejs = require('ejs');
-const _ = require('lodash');
-const semver = require('semver');
-
-const changelogPath = 'platform/ios/CHANGELOG.md';
-const changelog = fs.readFileSync(changelogPath, 'utf8');
-
-let outputMode = {};
-switch(process.argv[2]) {
- case "jazzy":
- outputMode.isJazzy = true; break;
- case "github":
- default:
- outputMode.isGitHub = true;
-}
-
-/*
- Find current and immediately previous releases by parsing git tags.
-*/
-let currentVersion = execSync('git describe --tags --match=ios-v*.*.* --abbrev=0')
- .toString()
- .trim()
- .replace('ios-v', '');
-
-let gitTags = execSync('git tag --list ios-v*.*.*')
- .toString()
- .split('\n')
- .map(function (tag) {
- tag = tag.replace('ios-v', '').trim();
- return semver.clean(tag);
- });
-let previousVersion = semver.maxSatisfying(gitTags, "<" + currentVersion);
-
-/*
- Parse the raw changelog text and split it into individual releases.
-
- This regular expression:
- - Matches lines starting with "## x.x.x".
- - Groups the version number.
- - Skips the (optional) release date.
- - Groups the changelog content.
- - Ends when another "## x.x.x" is found.
-*/
-const regex = /^## (\d+\.\d+\.\d+).*?\n(.+?)(?=\n^## \d+\.\d+\.\d+.*?\n)/gms;
-
-let releaseNotes = [];
-while (match = regex.exec(changelog)) {
- releaseNotes.push({
- 'version': match[1],
- 'changelog': match[2].trim(),
- });
-}
-
-/*
- Match the current tag with the most appropriate release notes.
-*/
-const versionsInReleaseNotes = _.map(releaseNotes, 'version');
-const bestReleaseNotesForCurrentVersion = semver.minSatisfying(versionsInReleaseNotes, ">=" + currentVersion);
-const currentReleaseNotes = _.find(releaseNotes, { version: bestReleaseNotesForCurrentVersion });
-
-if (!currentReleaseNotes) {
- console.error('Could not find a release section satisfying %s in %s — did you forget to rename the "master" section to %s?', currentVersion, changelogPath, currentVersion.split("-")[0]);
- process.exit(1);
-}
-
-/*
- Fill and print the release notes template.
-*/
-let templatedReleaseNotes;
-
-if (outputMode.isGitHub) {
- templatedReleaseNotes = ejs.render(fs.readFileSync('platform/ios/scripts/release-notes-github.md.ejs', 'utf8'), {
- 'CURRENTVERSION': currentVersion,
- 'PREVIOUSVERSION': previousVersion,
- 'CHANGELOG': currentReleaseNotes.changelog,
- 'isPrerelease': semver.prerelease(currentVersion)
- });
-}
-
-if (outputMode.isJazzy) {
- const minorReleaseSeries = semver.major(currentVersion) + "." + semver.minor(currentVersion) + ".0";
- const range = ">=" + minorReleaseSeries + " <" + currentVersion;
- const otherReleasesInSeries = _.filter(releaseNotes, function(release) {
- return semver.satisfies(release.version, range);
- });
-
- otherReleasesInSeries.forEach(function(release) {
- // Bump section headings from h3 to h4.
- release.changelog = release.changelog.replace(/^### /gm, '#### ');
- });
-
- templatedReleaseNotes = ejs.render(fs.readFileSync('platform/ios/scripts/release-notes-jazzy.md.ejs', 'utf8'), {
- 'CURRENTVERSION': currentVersion,
- 'CURRENTCHANGELOG': currentReleaseNotes.changelog,
- 'OTHERRELEASES': otherReleasesInSeries
- });
-}
-
-process.stdout.write(templatedReleaseNotes);
diff --git a/platform/ios/scripts/validate-framework-zip.sh b/platform/ios/scripts/validate-framework-zip.sh
deleted file mode 100755
index 0bcd094b69..0000000000
--- a/platform/ios/scripts/validate-framework-zip.sh
+++ /dev/null
@@ -1,131 +0,0 @@
-#!/usr/bin/env bash
-# Created by Cory Dolphin on 03/21/16.
-# Copyright (c) 2016 Twitter. All rights reserved.
-
-# Verifies a zip archive submission of SDKs passes basic static checks for format and contents.
-# This test is likely to generate false positives, e.g. even if your SDK passes this, you still must
-# test integration of your code fully.
-
-# Usage: $ ./validate_zip.sh <path to zip>
-
-set -e
-
-if [ ! -f "$1" ]; then
- printf "No file found at ${1}\n"
- printf "Usage: $ ./validate_zip.sh <path to zip>\n"; exit 1;
-fi
-
-function verifyFramework() {
- # set -x
- local FRAMEWORK_PATH=$1
- local FRAMEWORK_NAME=$(basename $FRAMEWORK_PATH)
- local PRODUCT="${FRAMEWORK_NAME%.*}"
- local BINARY_PATH="${FRAMEWORK_PATH}/${PRODUCT}"
- local HEADER_PATH="${FRAMEWORK_PATH}/Headers"
- printf "Found $FRAMEWORK_NAME. Verifying...\n"
-
- local MODULE_MAP=( $(find $FRAMEWORK_PATH -name "*.modulemap") )
- if [[ -z "$MODULE_MAP" ]]; then
- printf "ERROR: No modulemap found in $FRAMEWORK_NAME\n";
- exit 3;
- fi
- printf "$FRAMEWORK_NAME contains modulemap: ✓\n"
-
- # Verify there is a modulemap so Swift can use the framework
- if grep -q "link" "$MODULE_MAP"; then
- printf "$FRAMEWORK_NAME modulemap contains dependent system frameworks ✓\n"
- else
- printf "Warning: ${FRAMEWORK_NAME} does not list any system library dependencies. Double check all dependent frameworks and libraries are listed. \n";
- fi
-
- # Verify there is at least one header listed in the module map
- if grep -q ".*.h" "$MODULE_MAP"; then
- printf "$FRAMEWORK_NAME modulemap contains headers ✓\n";
- else
- printf "Error: ${FRAMEWORK_NAME} does not list any headers in the modulemap\n";
- exit 4;
- fi
-
- # Verify there is at least a headers folder
- if [[ ! -d "$HEADER_PATH" ]]; then
- printf "ERROR: Headers not not found in ${FRAMEWORK_NAME}\n";
- exit 5;
- fi
-
- # Verify the static lib at least has simulator and the two common ARM architectures
- local PRESENT_ARCHITECTURES=$( xcrun lipo -info "${BINARY_PATH}" )
- for arch in "armv7" "arm64" "x86_64"; do
- if [[ ! $PRESENT_ARCHITECTURES == *$arch* ]]; then
- printf "ERROR: Architecture ${arch} not found in ${FRAMEWORK_NAME}\n";
- exit 6;
- fi
- done
- printf "$FRAMEWORK_NAME contains simulator and device architectures: ✓\n"
-
- # Verify there are at least some bitcode segments in the rmv7 and arm64 slices
- # Note, this is not conclusive, it is possible some symbols are missing the segment
- for arch in "armv7" "arm64"; do
- local SYMBOLS=$(otool -l -arch "${arch}" "${BINARY_PATH}")
- if [[ ! $SYMBOLS == *"LLVM"* ]]; then
- printf "ERROR: Bitcode segments not found in ${FRAMEWORK_NAME}. Users will fail to archive their builds \n";
- exit 7;
- fi
- done
- printf "$FRAMEWORK_NAME contains bitcode: ✓\n"
-
- # Verify there is a plist file
- local PLIST_PATH=( $(find $FRAMEWORK_PATH -name Info.plist) )
- if [[ -z "$PLIST_PATH" ]]; then
- printf "ERROR: No Info.plist found in $FRAMEWORK_NAME\n"
- exit 8;
- fi
- printf "$FRAMEWORK_NAME contains Info.plist: ✓\n"
-
- # Verify there is a bundle identifier in Info.plist
- # And verify it does not contain any vestigial string templating
- local BUNDLE_NAME=$(/usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" "${PLIST_PATH}")
- if [[ -z "$BUNDLE_NAME" ]]; then
- printf "ERROR: Info.plist not found in $FRAMEWORK_NAME or CFBundleIdentifier not set\n";
- exit 9;
- elif [[ "$BUNDLE_NAME" == *"$"* ]]; then
- printf "ERROR: CFBundleIdentifier is invalid: $BUNDLE_NAME\n";
- exit 10;
- else
- printf "$FRAMEWORK_NAME has bundle: $BUNDLE_NAME ✓\n"
- fi
-
- # Verify there is a bundle version in the Info.plist
- local BUNDLE_VERSION=$(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" "${PLIST_PATH}")
- if [[ -z "$BUNDLE_VERSION" ]]; then
- printf "ERROR: No CFBundleShortVersionString found in $FRAMEWORK_NAME\n";
- exit 11;
- else
- printf "$FRAMEWORK_NAME has version: $BUNDLE_VERSION ✓\n"
- fi
-
- printf "===========================================\n"
- printf "Analyzed $PRODUCT version $BUNDLE_VERSION. \n"
- printf "Basic static verifications passed. 🚀🚀🚀 \n"
- printf "Please perform final verification testing \n\n"
-}
-
-# Extract the zip archive to a temporary location
-TEMP_DIR=$(mktemp -d /tmp/fabric_framework_validation.XXXXX)
-printf "Unzipping $(basename "$1") to $TEMP_DIR\n"
-unzip "$1" -d "$TEMP_DIR" &> /dev/null
-
-# Find frameworks and ensure they are at the top level, e.g. NOT nested within a sub directory
-printf "Scanning for frameworks...\n"
-FRAMEWORKS=( $(find "$TEMP_DIR" -name "*.framework" -maxdepth 1) )
-if [ -z "$FRAMEWORKS" ]; then
- printf "ERROR: No frameworks found at the top level within the zip archive.";
- exit 2;
-fi
-
-# Verify each framework found individually
-for framework in "${FRAMEWORKS[@]}"; do
- verifyFramework "$framework"
- printf ""
-done
-
-rm -r "$TEMP_DIR"