summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-01-22 01:52:16 -0800
committerMinh Nguyễn <mxn@1ec5.org>2016-01-22 14:45:58 -0800
commit5213abbde583d14bc9998b5346b1377bbcf8648b (patch)
treea1559db15a65bb270d84827cdbe23b1940619ef5
parent1ddce4cb3a7a1bd0b3fe9c15f09b4bb3c642c86d (diff)
downloadqtlocation-mapboxgl-5213abbde583d14bc9998b5346b1377bbcf8648b.tar.gz
[ios] Rewrote package readme
The build output’s readme now explains in full detail the installation process, rather than linking to an online resource that may not match the current version. Also cleaned up the tag-finding code to better handle double-digit situations.
-rw-r--r--ios/docs/pod-README.md63
-rwxr-xr-xplatform/ios/scripts/package.sh12
2 files changed, 67 insertions, 8 deletions
diff --git a/ios/docs/pod-README.md b/ios/docs/pod-README.md
index b308153de1..74d23914a0 100644
--- a/ios/docs/pod-README.md
+++ b/ios/docs/pod-README.md
@@ -1,9 +1,68 @@
-# Mapbox iOS SDK
+# [Mapbox iOS SDK](https://www.mapbox.com/ios-sdk/)
-An open source, OpenGL-based vector map solution for iOS with full styling capabilities and Cocoa Touch APIs.
+The Mapbox iOS SDK is an open-source framework for embedding interactive map views with scalable, customizable vector maps into Cocoa Touch applications on iOS 7.0 and above using Objective-C, Swift, or Interface Builder. It takes stylesheets that conform to the [Mapbox GL Style Specification](https://github.com/mapbox/mapbox-gl-style-spec/), applies them to vector tiles that conform to the [Mapbox Vector Tile Specification](https://github.com/mapbox/vector-tile-spec), and renders them using OpenGL.
For more information, check out [our online overview](https://www.mapbox.com/ios-sdk/).
[![](https://raw.githubusercontent.com/mapbox/mapbox-gl-native/master/ios/screenshot.png)]()
+## Changes in version {{VERSION}}
+
+{{CHANGES}}
+
See the [full changelog](https://github.com/mapbox/mapbox-gl-native/blob/master/CHANGELOG.md) online.
+
+## Installation
+
+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 framework
+
+This is the recommended workflow for manually integrating the SDK into an application targeting iOS 8 and above:
+
+1. Open the project editor and select your application target. Drag `Mapbox.framework` from the `dynamic` folder into the “Embedded Binaries” section of the General tab. In the sheet that appears, make sure “Copy items if needed” is checked, then click Finish.
+
+1. In the Build Phases tab, click the + button at the top and select “New Run Script Phase”. Enter the following code into the script text field:
+
+```bash
+bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/Mapbox.framework/strip-frameworks.sh"
+```
+
+(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.)
+
+### Static framework
+
+If your application targets iOS 7.x, you’ll need to install the static framework instead:
+
+1. Open the project editor and select your application target. Drag `Mapbox.framework` from the `static` folder into the “Embedded Binaries” section of the General tab. In the sheet that appears, make sure “Copy items if needed” is checked, then click Finish.
+
+1. Add the following Cocoa Touch frameworks and libraries to the “Linked Frameworks and Libraries” section:
+
+ - `GLKit.framework`
+ - `ImageIO.framework`
+ - `MobileCoreServices.framework`
+ - `QuartzCore.framework`
+ - `SystemConfiguration.framework`
+ - `libc++.dylib`
+ - `libsqlite3.dylib`
+ - `libz.dylib`
+
+1. In the Build Settings tab, add `-ObjC` to the “Other Linker Flags” (`OTHER_LDFLAGS`) build setting.
+
+## 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/).
+
+1. Mapbox Telemetry is a <a href="https://www.mapbox.com/telemetry/">powerful location analytics platform</a> included in this SDK. By default, anonymized location and usage data is sent to Mapbox whenever the host application causes it to be gathered. This SDK provides users with a way to individually opt out of Mapbox Telemetry. You can also add this opt-out setting to your application’s Settings screen, using the provided `Settings.bundle`.
+
+1. In order to show the user’s position on the map, you must first ask for their permission. In iOS 8 and above, this is accomplished by creating and setting the `NSLocationAlwaysUsageDescription` key in the `Info.plist` file.
+
+1. If you are on the free Starter plan, background location services must also be enabled. You can find instructions on how to do this in “[First steps with the Mapbox iOS SDK](https://www.mapbox.com/help/first-steps-ios-sdk/#background-location)”.
+
+## Usage
+
+In a XIB or storyboard, add a Custom View and set its custom class to `MGLMapView`. If you need to manipulate the map view programmatically, import the `Mapbox` module (Swift) or `Mapbox.h` umbrella header (Objective-C).
+
+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/).
diff --git a/platform/ios/scripts/package.sh b/platform/ios/scripts/package.sh
index b46fb479bc..39e49aa170 100755
--- a/platform/ios/scripts/package.sh
+++ b/platform/ios/scripts/package.sh
@@ -191,7 +191,7 @@ if [[ ${BUILD_STATIC} == true ]]; then
fi
step "Copying library resources…"
-SHORT_VERSION=$( git tag -l ios-v* | sed 's/^ios-v//' | sort -r | sed -n '1p' )
+SHORT_VERSION=$( git describe --tags --match=ios-v*.*.* --abbrev=0 | sed 's/^ios-v//' )
cp -pv LICENSE.md "${OUTPUT}"
cp -rv ios/app/Settings.bundle "${OUTPUT}"
if [[ ${BUILD_STATIC} == true ]]; then
@@ -220,14 +220,14 @@ if [ -z `which jazzy` ]; then
fi
fi
DOCS_OUTPUT="${OUTPUT}/documentation"
-DOCS_VERSION=$( git tag -l ios-v* | sed 's/^ios-//' | sort -r | grep -v '\-rc.' | grep -v '\-pre.' | sed -n '1p' | sed 's/^v//' )
+DOCS_VERSION=$( git describe --tags --match=ios-v*.*.* --abbrev=0 | sed -e 's/^ios-v//' -e 's/-.*//' )
rm -rf /tmp/mbgl
mkdir -p /tmp/mbgl/
README=/tmp/mbgl/README.md
-cat ios/docs/pod-README.md > ${README}
-echo >> ${README}
-echo -n "#" >> ${README}
-cat CHANGELOG.md | sed -n "/^## iOS ${DOCS_VERSION}/,/^##/p" | sed '$d' >> ${README}
+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}"
cp ${README} "${OUTPUT}"
jazzy \