This repository was archived by the owner on Nov 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake_documentation.sh
More file actions
executable file
·63 lines (54 loc) · 1.5 KB
/
Copy pathmake_documentation.sh
File metadata and controls
executable file
·63 lines (54 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
INFOPLIST_FILE="OpenCLKit/Info.plist"
VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${INFOPLIST_FILE}")
TMP_DIR="/tmp/docset_build"
BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [ ! "${BRANCH}" == "master" ]
then
echo "Documentation should be generated from master branch"
exit 1
fi
echo "Building documentation for $VERSION"
rm -rf "${TMP_DIR}"
mkdir -p "${TMP_DIR}"
appledoc \
--project-name "OpenCLKit" \
--project-company "Jan-Gerd Tenberge" \
--company-id com.jan-gerd \
--ignore .m \
-v "${VERSION}" \
--no-create-docset \
-h \
-o "${TMP_DIR}/html" \
.
ls -rtlha "${TMP_DIR}/html"
appledoc \
--project-name "OpenCLKit" \
--project-company "Jan-Gerd Tenberge" \
--company-id com.jan-gerd \
--docset-feed-url "https://janten.github.io/OpenCLKit/doc/feed.atom" \
--docset-package-url "https://janten.github.io/OpenCLKit/doc/%VERSION/OpenCLKit.xar" \
--docset-package-filename "OpenCLKit" \
--ignore .m \
-v "${VERSION}" \
--no-create-docset \
-u \
-o "${TMP_DIR}/docset" \
.
ls -rtlha "${TMP_DIR}/docset"
if git checkout gh-pages
then
git pull
rm -rf "doc/${VERSION}/"
mkdir -p "doc/${VERSION}/"
mv ${TMP_DIR}/html/html/* "doc/${VERSION}/"
mv ${TMP_DIR}/docset/publish/*.atom "doc/feed.atom"
mv ${TMP_DIR}/docset/publish/OpenCLKit.xar "doc/${VERSION}/"
git add .
git commit -m "Update documentation for version ${VERSION}"
git push -u origin gh-pages
git checkout "${BRANCH}"
else
echo "Could not switch to branch gh-pages"
fi
rm -rf "${TMP_DIR}"