summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-01-22 02:52:20 -0800
committerMinh Nguyễn <mxn@1ec5.org>2016-01-22 14:45:58 -0800
commit9427ddd373afd5205ba5d6d24dd5e2ff0a5a5fff (patch)
tree46cbf5b0d81aea4ea938e5f63cb18065f402fd5a
parent5213abbde583d14bc9998b5346b1377bbcf8648b (diff)
downloadqtlocation-mapboxgl-9427ddd373afd5205ba5d6d24dd5e2ff0a5a5fff.tar.gz
[ios] Polished package readme
Omit setup instructions for package formats not included in the build output.
-rw-r--r--ios/docs/pod-README.md9
-rwxr-xr-xplatform/ios/scripts/package.sh23
2 files changed, 26 insertions, 6 deletions
diff --git a/ios/docs/pod-README.md b/ios/docs/pod-README.md
index 74d23914a0..36b9c37713 100644
--- a/ios/docs/pod-README.md
+++ b/ios/docs/pod-README.md
@@ -16,6 +16,8 @@ See the [full changelog](https://github.com/mapbox/mapbox-gl-native/blob/master/
The Mapbox iOS SDK may be installed as either a dynamic framework or a static framework. (To reduce the download size, the static framework is omitted from some distributions; you may need to download the full package from the [release page](https://github.com/mapbox/mapbox-gl-native/releases/).)
+{{DYNAMIC}}
+
### Dynamic framework
This is the recommended workflow for manually integrating the SDK into an application targeting iOS 8 and above:
@@ -30,6 +32,9 @@ bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/Mapbox.framework/strip-fra
(The last step, courtesy of [Realm](https://github.com/realm/realm-cocoa/), is required for working around an [iOS App Store bug](http://www.openradar.me/radar?id=6409498411401216) when archiving universal binaries.)
+{{/DYNAMIC}}
+{{STATIC}}
+
### Static framework
If your application targets iOS 7.x, you’ll need to install the static framework instead:
@@ -49,6 +54,8 @@ If your application targets iOS 7.x, you’ll need to install the static framewo
1. In the Build Settings tab, add `-ObjC` to the “Other Linker Flags” (`OTHER_LDFLAGS`) build setting.
+{{/STATIC}}
+
## Configuration
1. Mapbox vector tiles require a Mapbox account and API access token. In the project editor, select the application target. In the Info tab, set `MGLMapboxAccessToken` to your access token. You can obtain one from the [Mapbox account page](https://www.mapbox.com/studio/account/tokens/).
@@ -65,4 +72,4 @@ In a XIB or storyboard, add a Custom View and set its custom class to `MGLMapVie
Full API documentation is included in this package, within the `documentation` folder. For more details, read “[First steps with the Mapbox iOS SDK](https://www.mapbox.com/guides/first-steps-ios-sdk/)” and consult the [online examples](https://www.mapbox.com/ios-sdk/examples/).
-If you have any questions, please contact mobile@mapbox.com. We welcome your [bug reports and feature requests](https://github.com/mapbox/mapbox-gl-native/issues/).
+If you have any questions, please contact <mobile@mapbox.com>. We welcome your [bug reports and feature requests](https://github.com/mapbox/mapbox-gl-native/issues/).
diff --git a/platform/ios/scripts/package.sh b/platform/ios/scripts/package.sh
index 39e49aa170..bbd92e3bef 100755
--- a/platform/ios/scripts/package.sh
+++ b/platform/ios/scripts/package.sh
@@ -220,22 +220,35 @@ if [ -z `which jazzy` ]; then
fi
fi
DOCS_OUTPUT="${OUTPUT}/documentation"
-DOCS_VERSION=$( git describe --tags --match=ios-v*.*.* --abbrev=0 | sed -e 's/^ios-v//' -e 's/-.*//' )
+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
cp ios/docs/pod-README.md "${README}"
CHANGES=/tmp/mbgl/CHANGES.md
-cat CHANGELOG.md | sed -n "/^## iOS ${DOCS_VERSION}/,/^##/p" | sed '$d' | sed "s/^## iOS ${DOCS_VERSION}//g" > "${CHANGES}"
-sed -i '' -e "s/{{VERSION}}/${DOCS_VERSION}/" -e "/{{CHANGES}}/r${CHANGES}" -e 's/{{CHANGES}}//g' "${README}"
+# http://stackoverflow.com/a/4858011/4585461
+sed -n -e '/^## iOS/{' -e ':a' -e 'n' -e '/^##/q' -e 'p' -e 'ba' -e '}' CHANGELOG.md > "${CHANGES}"
+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 "s/{{VERSION}}/${RELEASE_VERSION}/" \
+ -e "/{{CHANGES}}/r${CHANGES}" \
+ -e 's/{{CHANGES}}//g' \
+ -e '/{{DYNAMIC}}/d' -e '/{{\/DYNAMIC}}/d' \
+ -e '/{{STATIC}}/d' -e '/{{\/STATIC}}/d' \
+ "${README}"
cp ${README} "${OUTPUT}"
jazzy \
--sdk iphonesimulator \
--github-file-prefix https://github.com/mapbox/mapbox-gl-native/tree/${HASH} \
- --module-version ${DOCS_VERSION} \
+ --module-version ${SHORT_VERSION} \
--readme ${README} \
- --root-url https://www.mapbox.com/ios-sdk/api/${DOCS_VERSION}/ \
+ --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 \