[ios] Polished package readme
Omit setup instructions for package formats not included in the build output.
This commit is contained in:
committed by
Minh Nguyễn
parent
5213abbde5
commit
9427ddd373
@@ -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/).
|
||||
|
||||
@@ -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 \
|
||||
|
||||
Reference in New Issue
Block a user