-
-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build DocC documentation for iOS (#2104)
- Loading branch information
Showing
4 changed files
with
156 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -183,6 +183,19 @@ jobs: | |
- if: github.event_name == 'pull_request' | ||
uses: ./.github/actions/save-pr-number | ||
|
||
- name: Build DocC documentation main branch | ||
if: github.ref == 'refs/heads/main' | ||
run: | | ||
scripts/docc.sh | ||
- name: Deploy DocC documentation (main) 🚀 | ||
if: github.ref == 'refs/heads/main' | ||
uses: JamesIves/[email protected] | ||
with: | ||
branch: gh-pages | ||
folder: platform/ios/build/docs | ||
target-folder: ios/latest/ | ||
|
||
# Make Metal XCFramework release | ||
- name: Should make release? | ||
if: github.event.inputs.release == 'full' || github.event.inputs.release == 'pre' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# ``MapLibre`` | ||
|
||
@Metadata { | ||
@Available(iOS, introduced: "12.0") | ||
} | ||
|
||
Powerful, free and open-source mapping toolkit with full control over data sources and styling. | ||
|
||
## Overview | ||
|
||
[MapLibre Native](https://github.com/maplibre/maplibre-native) is a map rendering toolkit with support for iOS. It can be used as an alternative to MapKit. You have full control over the data sources used for rendering the map, as well as the styling. You can even participate in the development as MapLibre Native is free and open-source project. | ||
> Note: For information on creating and modifying map styles, see the [MapLibre Style Spec documentation](https://maplibre.org/maplibre-style-spec/). | ||
## Topics | ||
|
||
### Map | ||
|
||
- ``MLNMapView`` | ||
|
||
### Style Layers | ||
|
||
- ``MLNBackgroundStyleLayer`` | ||
- ``MLNCircleStyleLayer`` | ||
- ``MLNFillExtrusionStyleLayer`` | ||
- ``MLNFillStyleLayer`` | ||
- ``MLNForegroundStyleLayer`` | ||
- ``MLNHeatmapStyleLayer`` | ||
- ``MLNHillshadeStyleLayer`` | ||
- ``MLNLineStyleLayer`` | ||
- ``MLNRasterStyleLayer`` | ||
- ``MLNStyleLayer`` | ||
- ``MLNSymbolStyleLayer`` | ||
- ``MLNVectorStyleLayer`` | ||
|
||
### Sources | ||
|
||
- ``MLNComputedShapeSource`` | ||
- ``MLNImageSource`` | ||
- ``MLNRasterDEMSource`` | ||
- ``MLNRasterTileSource`` | ||
- ``MLNShapeSource`` | ||
- ``MLNSource`` | ||
- ``MLNTileSource`` | ||
|
||
### Shapes | ||
|
||
- ``MLNEmptyFeature`` | ||
- ``MLNMultiPoint`` | ||
- ``MLNMultiPolygon`` | ||
- ``MLNMultiPolygonFeature`` | ||
- ``MLNMultiPolyline`` | ||
- ``MLNMultiPolylineFeature`` | ||
- ``MLNMultiPolylineFeature`` | ||
- ``MLNPointAnnotation`` | ||
- ``MLNPointCollection`` | ||
- ``MLNPointCollectionFeature`` | ||
- ``MLNPolygon`` | ||
- ``MLNPolyline`` | ||
- ``MLNPolylineFeature`` | ||
- ``MLNShape`` | ||
- ``MLNShapeCollection`` | ||
- ``MLNShapeCollectionFeature`` | ||
|
||
### Snapshotter | ||
|
||
- ``MLNMapSnapshot`` | ||
- ``MLNMapSnapshotOptions`` | ||
- ``MLNMapSnapshotter`` | ||
|
||
### Offline support | ||
|
||
- ``MLNOfflinePack`` | ||
- ``MLNOfflineRegion`` | ||
- ``MLNOfflineStorage`` | ||
- ``MLNShapeOfflineRegion`` | ||
- ``MLNTilePyramidOfflineRegion`` | ||
|
||
### Annotations | ||
|
||
- ``MLNAnnotationImage`` | ||
- ``MLNAnnotationView`` | ||
- ``MLNPointFeature`` | ||
- ``MLNPointFeatureCluster`` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/bin/bash | ||
|
||
# This script is a bit of a hack to generate DocC documentation until Bazel has support for it. | ||
# https://github.com/bazelbuild/rules_apple/issues/2241 | ||
# To use this script, make sure the XCFramework is built with Bazel (see ios-ci.yml). | ||
# Then to start a local preview, run: | ||
# $ scripts/docc.sh bazel | ||
# You can also build the documentation locally | ||
# $ scripts/docc.sh | ||
# Then go to build/ios and run | ||
# $ python3 -m http.server | ||
# Go to http://localhost:8000/documentation/maplibre/ | ||
|
||
cmd="convert" | ||
if [[ "$1" == "preview" ]]; then | ||
cmd="preview" | ||
fi | ||
|
||
SDK_PATH=$(xcrun -sdk iphoneos --show-sdk-path) | ||
|
||
build_dir=build | ||
|
||
rm -rf "$build_dir"/symbol-graphs | ||
rm -rf "$build_dir"/headers/MapLibre | ||
rm -rf "$build_dir"/MapLibre.xcframework | ||
|
||
mkdir "$build_dir"/symbol-graphs | ||
mkdir -p "$build_dir"/headers/MapLibre | ||
|
||
# unzip built XCFramework in build dir | ||
unzip ../../bazel-bin/platform/ios/MapLibre.dynamic.xcframework.zip -d "$build_dir" | ||
|
||
# copy all public headers from XCFramework | ||
cp "$build_dir"/MapLibre.xcframework/ios-arm64/MapLibre.framework/Headers/*.h "$build_dir"/headers/MapLibre | ||
|
||
xcrun --toolchain swift clang \ | ||
-extract-api \ | ||
--product-name=MapLibre \ | ||
-isysroot $SDK_PATH \ | ||
-F "$SDK_PATH"/System/Library/Frameworks \ | ||
-I "$PWD" \ | ||
-I "$(realpath ../darwin/src)" \ | ||
-I "$build_dir"/headers \ | ||
-x objective-c-header \ | ||
-o "$build_dir"/symbol-graphs/MapLibre.symbols.json \ | ||
"$build_dir"/headers/MapLibre/*.h | ||
|
||
export DOCC_HTML_DIR=$(dirname $(xcrun --toolchain swift --find docc))/../share/docc/render | ||
$(xcrun --find docc) "$cmd" MapLibre.docc \ | ||
--fallback-display-name "MapLibre Native for iOS" \ | ||
--fallback-bundle-identifier org.swift.MyProject \ | ||
--fallback-bundle-version 0.0.1 \ | ||
--additional-symbol-graph-dir "$build_dir"/symbol-graphs \ | ||
--output-path "$build_dir"/MapLibre.doccarchive | ||
|
||
if [[ "$cmd" == "convert" ]]; then | ||
rm -rf build/docs | ||
$(xcrun --find docc) process-archive transform-for-static-hosting "$build_dir"/MapLibre.doccarchive --output-path build/docs | ||
fi |