summaryrefslogtreecommitdiff
path: root/platform/macos/scripts
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-06-13 14:47:13 -0700
committerKonstantin Käfer <mail@kkaefer.com>2016-06-14 10:02:06 +0200
commitb9702ef41a4cfdd0ab3107cfe5cec16ba3a4c230 (patch)
tree21a11f25139c129561d6830932a9eee4f2be895d /platform/macos/scripts
parent1e41c151f6edfba69037c854a5cb7abc18bb55e7 (diff)
downloadqtlocation-mapboxgl-b9702ef41a4cfdd0ab3107cfe5cec16ba3a4c230.tar.gz
[macos] Renamed OS X SDK to macOS SDK
Also renamed as many references to OS X as possible to macOS in documentation.
Diffstat (limited to 'platform/macos/scripts')
-rw-r--r--platform/macos/scripts/configure.sh18
-rwxr-xr-xplatform/macos/scripts/document.sh45
-rw-r--r--platform/macos/scripts/macostest.xcscheme56
-rwxr-xr-xplatform/macos/scripts/package.sh57
4 files changed, 176 insertions, 0 deletions
diff --git a/platform/macos/scripts/configure.sh b/platform/macos/scripts/configure.sh
new file mode 100644
index 0000000000..2952ec2535
--- /dev/null
+++ b/platform/macos/scripts/configure.sh
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+
+UNIQUE_RESOURCE_VERSION=dev
+PROTOZERO_VERSION=1.3.0
+BOOST_VERSION=1.60.0
+BOOST_LIBPROGRAM_OPTIONS_VERSION=1.60.0
+GLFW_VERSION=3.1.2
+SQLITE_VERSION=3.9.1
+ZLIB_VERSION=system
+NUNICODE_VERSION=1.6
+GEOMETRY_VERSION=0.5.0
+GEOJSONVT_VERSION=4.1.2
+VARIANT_VERSION=1.1.0
+RAPIDJSON_VERSION=1.0.2
+GTEST_VERSION=1.7.0
+PIXELMATCH_VERSION=0.9.0
+EARCUT_VERSION=0.11
+BENCHMARK_VERSION=1.0.0
diff --git a/platform/macos/scripts/document.sh b/platform/macos/scripts/document.sh
new file mode 100755
index 0000000000..e62a1e1668
--- /dev/null
+++ b/platform/macos/scripts/document.sh
@@ -0,0 +1,45 @@
+#!/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/-.*//' )
+
+SWIFT_VERSION=$(xcrun swift -version | head -n 1 | sed -e 's/^Apple Swift version //' -e 's/ .*$//')
+
+rm -rf /tmp/mbgl
+mkdir -p /tmp/mbgl/
+README=/tmp/mbgl/README.md
+cp platform/macos/docs/doc-README.md "${README}"
+# http://stackoverflow.com/a/4858011/4585461
+echo "## Changes in version ${RELEASE_VERSION}" >> "${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}
+
+jazzy \
+ --config platform/macos/jazzy.yml \
+ --sdk macosx \
+ --swift-version $SWIFT_VERSION \
+ --github-file-prefix https://github.com/mapbox/mapbox-gl-native/tree/${BRANCH} \
+ --module-version ${SHORT_VERSION} \
+ --readme ${README} \
+ --output ${OUTPUT}
+# https://github.com/realm/jazzy/issues/411
+find ${OUTPUT} -name *.html -exec \
+ perl -pi -e 's/Mapbox\s+(Docs|Reference)/Mapbox macOS SDK $1/' {} \;
diff --git a/platform/macos/scripts/macostest.xcscheme b/platform/macos/scripts/macostest.xcscheme
new file mode 100644
index 0000000000..ba6f6a6f4b
--- /dev/null
+++ b/platform/macos/scripts/macostest.xcscheme
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+ LastUpgradeVersion = "0720"
+ version = "1.3">
+ <BuildAction
+ parallelizeBuildables = "YES"
+ buildImplicitDependencies = "YES">
+ </BuildAction>
+ <TestAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ shouldUseLaunchSchemeArgsEnv = "YES">
+ <Testables>
+ <TestableReference
+ skipped = "NO">
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "6EE19CDFBCE7BD04FE561812"
+ BuildableName = "macostest.xctest"
+ BlueprintName = "macostest"
+ ReferencedContainer = "container:../../build/macos/platform/macos/platform.xcodeproj">
+ </BuildableReference>
+ </TestableReference>
+ </Testables>
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </TestAction>
+ <LaunchAction
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+ launchStyle = "0"
+ useCustomWorkingDirectory = "NO"
+ ignoresPersistentStateOnLaunch = "NO"
+ debugDocumentVersioning = "YES"
+ debugServiceExtension = "internal"
+ allowLocationSimulation = "YES">
+ <AdditionalOptions>
+ </AdditionalOptions>
+ </LaunchAction>
+ <ProfileAction
+ buildConfiguration = "Release"
+ shouldUseLaunchSchemeArgsEnv = "YES"
+ savedToolIdentifier = ""
+ useCustomWorkingDirectory = "NO"
+ debugDocumentVersioning = "YES">
+ </ProfileAction>
+ <AnalyzeAction
+ buildConfiguration = "Debug">
+ </AnalyzeAction>
+ <ArchiveAction
+ buildConfiguration = "Release"
+ revealArchiveInOrganizer = "YES">
+ </ArchiveAction>
+</Scheme>
diff --git a/platform/macos/scripts/package.sh b/platform/macos/scripts/package.sh
new file mode 100755
index 0000000000..a6952e8ab2
--- /dev/null
+++ b/platform/macos/scripts/package.sh
@@ -0,0 +1,57 @@
+#!/usr/bin/env bash
+
+set -e
+set -o pipefail
+set -u
+
+NAME=Mapbox
+OUTPUT=build/macos/pkg
+DERIVED_DATA=build/macos
+PRODUCTS=${DERIVED_DATA}/Build/Products
+
+BUILDTYPE=${BUILDTYPE:-Release}
+GCC_GENERATE_DEBUGGING_SYMBOLS=${SYMBOLS:-YES}
+
+function step { >&2 echo -e "\033[1m\033[36m* $@\033[0m"; }
+function finish { >&2 echo -en "\033[0m"; }
+trap finish EXIT
+
+rm -rf ${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%-*}
+
+step "Building targets (build ${PROJ_VERSION}, version ${SEM_VERSION})…"
+xcodebuild \
+ GCC_GENERATE_DEBUGGING_SYMBOLS=${GCC_GENERATE_DEBUGGING_SYMBOLS} \
+ CURRENT_PROJECT_VERSION=${PROJ_VERSION} \
+ CURRENT_SHORT_VERSION=${SHORT_VERSION} \
+ CURRENT_SEMANTIC_VERSION=${SEM_VERSION} \
+ CURRENT_COMMIT_HASH=${HASH} \
+ -derivedDataPath ${DERIVED_DATA} \
+ -workspace ./platform/macos/macos.xcworkspace \
+ -scheme dynamic \
+ -configuration ${BUILDTYPE} \
+ -jobs ${JOBS} | xcpretty
+
+step "Copying dynamic framework into place"
+mkdir -p "${OUTPUT}/${NAME}.framework"
+cp -r ${PRODUCTS}/${BUILDTYPE}/${NAME}.framework/* "${OUTPUT}/${NAME}.framework"
+if [[ -e ${PRODUCTS}/${BUILDTYPE}/${NAME}.framework.dSYM ]]; then
+ cp -r ${PRODUCTS}/${BUILDTYPE}/${NAME}.framework.dSYM "${OUTPUT}"
+fi
+
+if [[ "${GCC_GENERATE_DEBUGGING_SYMBOLS}" == false ]]; then
+ step "Stripping binaries…"
+ strip -Sx "${OUTPUT}/${NAME}.framework/${NAME}"
+fi
+
+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"