summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-01-22 11:57:58 -0800
committerMinh Nguyễn <mxn@1ec5.org>2016-01-22 14:45:58 -0800
commit83deed6a8873dca5163dfe8557a36b8289a2c6e5 (patch)
tree78742839b1401c9b965a11022308564fa5f94f8d
parent5d516c36034a5f18f91c1377a1cd49a3f532b204 (diff)
downloadqtlocation-mapboxgl-83deed6a8873dca5163dfe8557a36b8289a2c6e5.tar.gz
[ios] make idocument
Split API documentation generation into a separate make target that can be run independently of building the SDK.
-rw-r--r--Makefile1
-rwxr-xr-xplatform/ios/scripts/document.sh32
-rwxr-xr-xplatform/ios/scripts/package.sh25
3 files changed, 36 insertions, 22 deletions
diff --git a/Makefile b/Makefile
index f2d13785c9..cefbfb424b 100644
--- a/Makefile
+++ b/Makefile
@@ -54,6 +54,7 @@ ipackage-strip: Xcode/ios ; @JOBS=$(JOBS) BITCODE=$(BITCODE) FORMAT=$(FORMAT) BU
ipackage-sim: Xcode/ios ; @JOBS=$(JOBS) BUILDTYPE=Debug BITCODE=$(BITCODE) FORMAT=dynamic BUILD_DEVICE=false SYMBOLS=$(SYMBOLS) ./platform/ios/scripts/package.sh
iframework: Xcode/ios ; @JOBS=$(JOBS) BITCODE=$(BITCODE) FORMAT=dynamic BUILD_DEVICE=$(BUILD_DEVICE) SYMBOLS=$(SYMBOLS) ./platform/ios/scripts/package.sh
itest: ipackage-sim ; ./platform/ios/scripts/test.sh
+idocument: ; OUTPUT=$(OUTPUT) README=$(README) ./platform/ios/scripts/document.sh
.PHONY: xpackage xpackage-strip xctest
xpackage: Xcode/osx ; @JOBS=$(JOBS) ./platform/osx/scripts/package.sh
diff --git a/platform/ios/scripts/document.sh b/platform/ios/scripts/document.sh
new file mode 100755
index 0000000000..b865b33f3c
--- /dev/null
+++ b/platform/ios/scripts/document.sh
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+
+set -e
+set -o pipefail
+set -u
+
+if [ -z `which jazzy` ]; then
+ 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
+
+OUTPUT=${OUTPUT:-documentation}
+README=${README:-README.md}
+
+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/-.*//' )
+
+jazzy \
+ --sdk iphonesimulator \
+ --github-file-prefix https://github.com/mapbox/mapbox-gl-native/tree/${BRANCH} \
+ --module-version ${SHORT_VERSION} \
+ --readme ${README} \
+ --root-url https://www.mapbox.com/ios-sdk/api/${RELEASE_VERSION}/ \
+ --output ${OUTPUT}
+# https://github.com/realm/jazzy/issues/411
+find ${OUTPUT} -name *.html -exec \
+ perl -pi -e 's/Mapbox\s+(Docs|Reference)/Mapbox iOS SDK $1/' {} \;
diff --git a/platform/ios/scripts/package.sh b/platform/ios/scripts/package.sh
index aabc48a6f0..eff587c7db 100755
--- a/platform/ios/scripts/package.sh
+++ b/platform/ios/scripts/package.sh
@@ -209,18 +209,8 @@ if [[ ${BUILD_DYNAMIC} == true ]]; then
plutil -replace CFBundleShortVersionString -string "${SHORT_VERSION}" "${OUTPUT}/dynamic/${NAME}.framework/Info.plist"
cp -pv ios/framework/strip-frameworks.sh "${OUTPUT}/dynamic/${NAME}.framework/strip-frameworks.sh"
fi
+sed -n -e '/^## iOS/,$p' CHANGELOG.md > "${OUTPUT}/CHANGELOG.md"
-step "Generating API documentation…"
-if [ -z `which jazzy` ]; then
- 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}/documentation"
-RELEASE_VERSION=$( echo ${SHORT_VERSION} | sed -e 's/^ios-v//' -e 's/-.*//' )
rm -rf /tmp/mbgl
mkdir -p /tmp/mbgl/
README=/tmp/mbgl/README.md
@@ -236,15 +226,6 @@ sed -i '' \
-e '/{{STATIC}}/d' -e '/{{\/STATIC}}/d' \
"${README}"
cp ${README} "${OUTPUT}"
-sed -n -e '/^## iOS/,$p' CHANGELOG.md > "${OUTPUT}/CHANGELOG.md"
-jazzy \
- --sdk iphonesimulator \
- --github-file-prefix https://github.com/mapbox/mapbox-gl-native/tree/${HASH} \
- --module-version ${SHORT_VERSION} \
- --readme ${README} \
- --root-url https://www.mapbox.com/ios-sdk/api/${RELEASE_VERSION}/ \
- --output ${DOCS_OUTPUT}
-# https://github.com/realm/jazzy/issues/411
-find ${DOCS_OUTPUT} -name *.html -exec \
- perl -pi -e 's/Mapbox\s+(Docs|Reference)/Mapbox iOS SDK $1/' {} \;
+step "Generating API documentation…"
+make idocument OUTPUT="${OUTPUT}/documentation" README=${README}