-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuilddocs.sh
executable file
·14 lines (14 loc) · 1.06 KB
/
builddocs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# remove old built documentation
rm -rf .build
# build the web version for github
xcodebuild docbuild -scheme PonyExpress -destination generic/platform=iOS OTHER_DOCC_FLAGS="--transform-for-static-hosting --hosting-base-path PonyExpress --output-path Docs"
# build the Xcode doccarchive version
xcodebuild docbuild -scheme PonyExpress -destination generic/platform=iOS OTHER_DOCC_FLAGS="--output-path PonyExpress.doccarchive"
# move that Xcode version into a hidden folder and open it to install it
mkdir .build
mv PonyExpress.doccarchive .build/PonyExpress.doccarchive
open .build/PonyExpress.doccarchive
# format all json files in the Docs folder so that the built files are deterministic
find Docs -name *.json -exec bash -c 'jq -M -c --sort-keys . < "{}" > "{}.temp"; mv "{}.temp" "{}"' \;
# add an empty Package.swift into Docs/ so that it doesn't appear in Xcode
printf "// swift-tools-version: 5.7\n// The swift-tools-version declares the minimum version of Swift required to build this package.\n\nimport PackageDescription\n\nlet package = Package()\n" > Docs/Package.swift