Skip to content

Commit 6acf02a

Browse files
committed
Create generate-api-docs.sh
1 parent 53bf607 commit 6acf02a

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

Scripts/generate-api-docs.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#! /bin/sh
2+
3+
set -e
4+
5+
if ! which jazzy >/dev/null; then
6+
echo "Error: Jazzy not installed, see https://github.com/realm/Jazzy or run 'gem install jazzy' to install it"
7+
exit 1
8+
fi
9+
10+
if ! which jq >/dev/null; then
11+
echo "Error: jq not installed, run 'brew install jq' to install it"
12+
exit 1
13+
fi
14+
15+
read -p 'Enter release tag (without quotes): ' RELEASE_TAG
16+
17+
AUTHOR_NAME="Pusher Limited"
18+
AUTHOR_URL="https://pusher.com"
19+
GITHUB_ORIGIN=$(git remote get-url origin)
20+
GITHUB_URL=${GITHUB_ORIGIN%".git"}
21+
MODULE_NAME=$(swift package dump-package | jq --raw-output '.name')
22+
23+
echo "Generating public API docs from release tag $RELEASE_TAG"
24+
25+
# The 'arch -x86_64' command is redundant on Intel Macs, and runs Jazzy under Rosetta 2 on Apple Silicon Macs for compatibility
26+
arch -x86_64 jazzy \
27+
--module $MODULE_NAME \
28+
--module_version $RELEASE_TAG \
29+
--swift-build-tool spm \
30+
--author $AUTHOR_NAME \
31+
--author_url $AUTHOR_URL \
32+
--github_url $GITHUB_URL \
33+
--github-file-prefix $GITHUB_URL/tree/$RELEASE_TAG

0 commit comments

Comments
 (0)