forked from mattnotmitt/doxygen-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
executable file
·38 lines (31 loc) · 920 Bytes
/
entrypoint.sh
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
#!/bin/sh
# execute doxygen
# $1 is the path to the Doxyfile
# $2 is the directory where doxygen should be executed
# $3 is a boolean: true -> enable latex generation, false -> skip latex generation
if [ ! -d $2 ]; then
echo "Path $2 could not be found!"
fi
cd $2
if [ ! -f $1 ]; then
echo "File $1 could not be found!"
fi
# install packages; add latex-related packages only if enabled
if [ ! -z $3 ] ; then
BUILD_LATEX=$3 && $(grep -q GENERATE_LATEX\\s\*=\\s\*YES $1)
LATEX_DIR="$(sed -n -e 's/^OUTPUT_DIRECTORY\s*=\s*//p' Doxyfile)/$(sed -n -e 's/^LATEX_OUTPUT\s*=\s*//p' Doxyfile)"
else
BUILD_LATEX=0
fi
PACKAGES="doxygen graphviz ttf-freefont"
if [ "$BUILD_LATEX" = true ] ; then
PACKAGES="$PACKAGES perl build-base texlive-full biblatex"
fi
apk add $PACKAGES
# run "regular" doxygen
doxygen $1
# if enabled, make latex pdf output
if [ "$BUILD_LATEX" = true ] ; then
cd $LATEX_DIR
make
fi