forked from sailfishos-patches/patchmanager
-
Notifications
You must be signed in to change notification settings - Fork 1
/
makedocs
executable file
·67 lines (57 loc) · 2.13 KB
/
makedocs
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
64
65
66
67
#!/bin/sh
#
# Copyright (c) 2023, Peter G. "nephros" <[email protected]>
# Licensed under the terms of the BSD 3-Clause License
#
# This will build Documentation.
#
# It is intended to be run from within the source tree.
# It is also used in Github Actions.
#
# Note that there are large differnces in the qdoc command between Qt 5.6
# (SFOS), and later Qt versions.
# In order to enable building in newer Qt versions, changes in both the qdoc
# config files as well as the code comments will be required.
printf '####### %s starting... #######\n' $0
### verify "build" environment
printf '## Verifying build environment:\n'
switched_dirs="false"
if gitroot=$(git rev-parse --show-toplevel 2>/dev/null); then
printf '## found a git root at %s, running from there...\n' "$gitroot"
pushd $gitroot >/dev/null || cd $gitroot
switched_dirs="true"
else
printf '## this is not a git repo, assuming root is %s\n' "$PWD"
fi
# this is searched relative to the qdocconf file!!
export SAILFISH_INSTALL_DOCS=sailfish-qdoc-template/config
qdocver=$(qdoc --version)
if [ $? -ne 0 ]; then
printf '## ERROR: qdoc does not seem to work! Please check your qt5 installation\n'
exit 1
else
printf '## QDoc is: %s\n' "$qdocver"
fi
if [ ! -e doc/qdoc/sailfish-qdoc-template ]; then
printf '## ERROR: sailfish-qdoc-template does not exist\n'
printf "## You should \'git clone --depth 1 -b upgrade-4.5.0 https://github.com/sailfishos/sailfish-qdoc-template doc/qdoc/sailfish-qdoc-template'\n"
exit 1
fi
OUT=$PWD/doc/generated
export QT_VER=5
export QT_INSTALL_DOCS
if [ -z "$QT_INSTALL_DOCS" ]; then
if [ -f /usr/share/doc/qt5/global/macros.qdocconf ]; then
QT_INSTALL_DOCS=/usr/share/doc/qt5
elif [ -f /usr/share/qt5/doc/global/macros.qdocconf ]; then
QT_INSTALL_DOCS=/usr/share/qt5/doc
fi
fi
printf '## Generating Docs...\n'
[ -d $OUT ] && rm -r $OUT
qdoc --no-examples --outputdir $OUT --outputformat HTML --installdir $QMAKE_INSTALL_ROOT/doc doc/qdoc/master.qdocconf --single-exec $@
printf '## End of Doc generation at "%s"\n' "$OUT"
[ $switched_dirs = "true" ] && popd >/dev/null || cd -
printf '####### %s done. #######\n' $0
# always exit 0 for CI runs:
exit 0