diff options
Diffstat (limited to 'platform/macos/scripts')
-rwxr-xr-x | platform/macos/scripts/deploy-packages.sh | 144 | ||||
-rwxr-xr-x | platform/macos/scripts/document.sh | 52 | ||||
-rwxr-xr-x | platform/macos/scripts/metrics.sh | 7 | ||||
-rwxr-xr-x | platform/macos/scripts/package.sh | 130 |
4 files changed, 0 insertions, 333 deletions
diff --git a/platform/macos/scripts/deploy-packages.sh b/platform/macos/scripts/deploy-packages.sh deleted file mode 100755 index bb90f3a8b0..0000000000 --- a/platform/macos/scripts/deploy-packages.sh +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail -set -u - -# dynamic environment variables: -# VERSION_TAG={determined automatically}: Version tag in format macos-vX.X.X-pre.X -# GITHUB_RELEASE=true: Upload to github -# BINARY_DIRECTORY=build/macos/deploy: Directory in which to save test packages - -# 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 -# - "wget" is required for downloading the zip files from s3 -# - 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 - -publish() { - OPTRESET=1 - OPTIND= - local arg - local rule= - local suffix= - local app= - while getopts 'r:s:a:' arg; do - case ${arg} in - r) rule=${OPTARG};; - s) suffix=${OPTARG};; - a) app=${OPTARG};; - *) "Usage: [-r rule] [-s suffix] [-a app]"; return - esac - done - - step "Building: make ${rule} ${suffix}" - make ${rule} - step "Publishing ${rule} with ${suffix}" - local file_name="" - if [ -z ${suffix} ] - then - file_name=mapbox-macos-sdk-${PUBLISH_VERSION}.zip - else - file_name=mapbox-macos-sdk-${PUBLISH_VERSION}-${suffix}.zip - fi - step "Compressing ${file_name}…" - cd build/macos/pkg - rm -f ../deploy/${file_name} - zip -yr ../deploy/${file_name} * - cd - - if [[ "${GITHUB_RELEASE}" == true ]]; then - echo "Uploading ${file_name} to GitHub" - github-release upload \ - --tag "macos-v${PUBLISH_VERSION}" \ - --name ${file_name} \ - --file "${BINARY_DIRECTORY}/${file_name}" > /dev/null - fi - if [ ${app} ]; then - file_name="Mapbox GL.app.zip" - step "Compressing ${file_name}…" - cd build/macos/app - rm -f "${file_name}" - zip -yr "../deploy/${file_name}" 'Mapbox GL.app' - cd - - if [[ "${GITHUB_RELEASE}" == true ]]; then - echo "Uploading ${file_name} to GitHub" - github-release upload \ - --tag "macos-v${PUBLISH_VERSION}" \ - --name "${file_name}" \ - --file "${BINARY_DIRECTORY}/${file_name}" > /dev/null - fi - fi -} - -export GITHUB_USER=mapbox -export GITHUB_REPO=mapbox-gl-native -export BUILDTYPE=Release - -VERSION_TAG=${VERSION_TAG:-''} -PUBLISH_VERSION= -BINARY_DIRECTORY=${BINARY_DIRECTORY:-build/macos/deploy} -GITHUB_RELEASE=${GITHUB_RELEASE:-true} -PUBLISH_PRE_FLAG='' - -if [[ ${GITHUB_RELEASE} = "true" ]]; then - GITHUB_RELEASE=true # Assign bool, not just a string - - 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 -fi - -if [[ -z ${VERSION_TAG} ]]; then - step "Determining version number from most recent relevant git tag…" - VERSION_TAG=$( git describe --tags --match=macos-v*.*.* --abbrev=0 ) - echo "Found tag: ${VERSION_TAG}" -fi - -if [[ $( echo ${VERSION_TAG} | grep --invert-match macos-v ) ]]; then - echo "Error: ${VERSION_TAG} is not a valid macOS version tag" - echo "VERSION_TAG should be in format: macos-vX.X.X-pre.X" - exit 1 -fi - -if [[ $( wget --spider -O- https://api.github.com/repos/${GITHUB_USER}/${GITHUB_REPO}/releases/tags/${VERSION_TAG} 2>&1 | grep -c "404 Not Found" ) == 0 ]]; 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/^macos-v//' ) -git checkout ${VERSION_TAG} - -step "Deploying version ${PUBLISH_VERSION}…" - -if [[ ${#} -eq 3 && $3 == "-g" ]]; then - GITHUB_RELEASE=true -fi - -make clean && make distclean -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 - github-release release \ - --tag "macos-v${PUBLISH_VERSION}" \ - --name "macos-v${PUBLISH_VERSION}" \ - --draft ${PUBLISH_PRE_FLAG} -fi - -publish -r xpackage -s symbols -publish -r "xpackage SYMBOLS=NO" -a true - -step "Finished deploying ${PUBLISH_VERSION} in $(($SECONDS / 60)) minutes and $(($SECONDS % 60)) seconds" diff --git a/platform/macos/scripts/document.sh b/platform/macos/scripts/document.sh deleted file mode 100755 index 8d8d1c7bf2..0000000000 --- a/platform/macos/scripts/document.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail -set -u - -if [ -z `which jazzy` ]; then - echo "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/macos/INSTALL.md" - exit 1 - fi -fi - -OUTPUT=${OUTPUT:-documentation} - -BRANCH=$( git describe --tags --match=macos-v*.*.* --abbrev=0 ) -SHORT_VERSION=$( echo ${BRANCH} | sed 's/^macos-v//' ) -RELEASE_VERSION=$( echo ${SHORT_VERSION} | sed -e 's/^macos-v//' -e 's/-.*//' ) - -rm -rf /tmp/mbgl -mkdir -p /tmp/mbgl/ -README=/tmp/mbgl/README.md -if [[ ${STANDALONE:-} ]]; then - cp platform/macos/docs/pod-README.md "${README}" - perl -pi -e 's|https://raw.githubusercontent.com/mapbox/mapbox-gl-native/master/platform/macos/docs/||' \ - "${README}" -else - cp platform/macos/docs/doc-README.md "${README}" -fi -# http://stackoverflow.com/a/4858011/4585461 -echo "## Changes in [version ${RELEASE_VERSION}](https://github.com/mapbox/mapbox-gl-native/releases/tag/${BRANCH})" >> "${README}" -sed -n -e '/^## /{' -e ':a' -e 'n' -e '/^## /q' -e 'p' -e 'ba' -e '}' platform/macos/CHANGELOG.md >> "${README}" - -rm -rf ${OUTPUT} -mkdir -p ${OUTPUT} - -cp -r platform/darwin/docs/img "${OUTPUT}" -cp -r platform/macos/docs/img "${OUTPUT}" - -jazzy \ - --config platform/macos/jazzy.yml \ - --sdk macosx \ - --github-file-prefix https://github.com/mapbox/mapbox-gl-native/tree/${BRANCH} \ - --module-version ${SHORT_VERSION} \ - --readme ${README} \ - --documentation="platform/{darwin,macos}/docs/guides/*.md" \ - --theme platform/darwin/docs/theme \ - --output ${OUTPUT} \ - --title "Maps SDK for macOS" \ - --module-version ${SHORT_VERSION} diff --git a/platform/macos/scripts/metrics.sh b/platform/macos/scripts/metrics.sh deleted file mode 100755 index 91dfc60358..0000000000 --- a/platform/macos/scripts/metrics.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -# Track individual architectures -scripts/check_binary_size.js "build/macos/pkg/Mapbox.framework/Versions/Current/Mapbox" "macOS x86_64" diff --git a/platform/macos/scripts/package.sh b/platform/macos/scripts/package.sh deleted file mode 100755 index 407b116b06..0000000000 --- a/platform/macos/scripts/package.sh +++ /dev/null @@ -1,130 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail -set -u - -NAME=Mapbox -OUTPUT=build/macos/pkg -APP_OUTPUT=build/macos/app -DERIVED_DATA=build/macos - -BUILDTYPE=${BUILDTYPE:-Release} -SYMBOLS=${SYMBOLS:-YES} -PRODUCTS=${DERIVED_DATA}/${BUILDTYPE} - -function step { >&2 echo -e "\033[1m\033[36m* $@\033[0m"; } -function finish { >&2 echo -en "\033[0m"; } -trap finish EXIT - -rm -rf ${OUTPUT} ${APP_OUTPUT} - -HASH=`git log | head -1 | awk '{ print $2 }' | cut -c 1-10` && true -PROJ_VERSION=$(git rev-list --count HEAD) -SEM_VERSION=$( git describe --tags --match=macos-v*.*.* --abbrev=0 | sed 's/^macos-v//' ) -SHORT_VERSION=${SEM_VERSION%-*} - -CI_XCCONFIG='' -if [[ ! -z "${CI:=}" ]]; then - xcconfig='platform/darwin/ci.xcconfig' - echo "CI environment, using ${xcconfig}" - CI_XCCONFIG="-xcconfig ./${xcconfig}" -fi - -step "Building dynamic framework (build ${PROJ_VERSION}, version ${SEM_VERSION})…" -xcodebuild \ - CURRENT_PROJECT_VERSION=${PROJ_VERSION} \ - CURRENT_SHORT_VERSION=${SHORT_VERSION} \ - CURRENT_SEMANTIC_VERSION=${SEM_VERSION} \ - CURRENT_COMMIT_HASH=${HASH} \ - ${CI_XCCONFIG} \ - -derivedDataPath ${DERIVED_DATA} \ - -archivePath "${APP_OUTPUT}/macosapp.xcarchive" \ - -workspace ./platform/macos/macos.xcworkspace \ - -scheme dynamic \ - -configuration ${BUILDTYPE} \ - -jobs ${JOBS} \ - build | xcpretty - -step "Copying dynamic framework into place" -mkdir -p "${OUTPUT}/${NAME}.framework" -ditto ${PRODUCTS}/${NAME}.framework "${OUTPUT}/${NAME}.framework" -if [[ -e ${PRODUCTS}/${NAME}.framework.dSYM ]]; then - cp -r ${PRODUCTS}/${NAME}.framework.dSYM "${OUTPUT}" -fi - -step "Building and archiving Mapbox GL.app (build ${PROJ_VERSION}, version ${SEM_VERSION})…" -if [[ ${BUILDTYPE} == Release ]]; then - mkdir -p ${APP_OUTPUT} - xcodebuild \ - CURRENT_PROJECT_VERSION=${PROJ_VERSION} \ - CURRENT_SHORT_VERSION=${SHORT_VERSION} \ - CURRENT_SEMANTIC_VERSION=${SEM_VERSION} \ - CURRENT_COMMIT_HASH=${HASH} \ - ${CI_XCCONFIG} \ - -derivedDataPath ${DERIVED_DATA} \ - -archivePath "${APP_OUTPUT}/macosapp.xcarchive" \ - -workspace ./platform/macos/macos.xcworkspace \ - -scheme macosapp \ - -configuration ${BUILDTYPE} \ - -jobs ${JOBS} \ - archive | xcpretty -fi - -if [[ ${SYMBOLS} = NO ]]; then - step "Stripping symbols from binaries" - strip -Sx "${OUTPUT}/${NAME}.framework/${NAME}" -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 [[ ${BUILDTYPE} == Release ]]; then - validate_dsym \ - "${OUTPUT}/${NAME}.framework.dSYM/Contents/Resources/DWARF/${NAME}" \ - "${OUTPUT}/${NAME}.framework/${NAME}" - - step "Exporting Mapbox GL.app" - xcodebuild \ - ${CI_XCCONFIG} \ - -exportArchive \ - -archivePath "${APP_OUTPUT}/macosapp.xcarchive" \ - -exportPath "${APP_OUTPUT}" \ - -exportOptionsPlist platform/macos/ExportOptions.plist -fi - -function create_podspec { - step "Creating local podspec…" - [[ $SYMBOLS = YES ]] && POD_SUFFIX="-symbols" || POD_SUFFIX="" - POD_SOURCE_PATH=' :path => ".",' - POD_FRAMEWORKS=" m.vendored_frameworks = '"${NAME}".framework'" - INPUT_PODSPEC=platform/macos/${NAME}-macOS-SDK${POD_SUFFIX}.podspec - OUTPUT_PODSPEC=${OUTPUT}/${NAME}-macOS-SDK${POD_SUFFIX}.podspec - sed "s/.*:http.*/${POD_SOURCE_PATH}/" ${INPUT_PODSPEC} > ${OUTPUT_PODSPEC} - sed -i '' "s/.*vendored_frameworks.*/${POD_FRAMEWORKS}/" ${OUTPUT_PODSPEC} -} - -create_podspec - -step "Copying library resources…" -cp -pv LICENSE.md "${OUTPUT}" -cp -pv platform/macos/docs/pod-README.md "${OUTPUT}/README.md" -sed -n -e '/^## /,$p' platform/macos/CHANGELOG.md > "${OUTPUT}/CHANGELOG.md" - -step "Generating API documentation…" -make xdocument OUTPUT="${OUTPUT}/documentation" - -step "Checking that all public symbols are exported…" -node platform/darwin/scripts/check-public-symbols.js macOS |