forked from ringcentral/jagger8
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make_docu.sh
executable file
·72 lines (57 loc) · 2.07 KB
/
make_docu.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
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
68
69
70
71
#!/bin/bash
# Required software:
# 1. Doxygen (version 1.8.4): http://www.stack.nl/~dimitri/doxygen/download.html
#with_swagger - set true if you want to generate swagger documentation for jaas
#version - version of the documentation. Will be on the main page of the doxygen documentation
with_swagger=$1
version=$2
if [ -z "$with_swagger" ]; then
with_swagger=false
fi
echo "Use swagger: $with_swagger"
echo "Version: $version"
# set version - don't change text (doxygen will use it)
if [ ! -z "$version" ]; then
echo "Version: $version" > ./doc/setup/JaggerVersion.txt
fi
# main docu
echo "=== Generating doxygen documentation ==="
rm `ls ./doc/html/*.* | grep -v "header.html" | grep -v "tab-panel.css" | grep -v "tab-panel.js"`
doxygen ./doc/setup/Doxyfile
# swagger docu
if [ "$with_swagger" = true ] ; then
echo "=== Generating swagger documentation ==="
swagger_html_path="./jaas/target/asciidoc/html/index.html"
swagger_pdf_path="./jaas/target/asciidoc/pdf/index.pdf"
swagger_docs_dest="./doc/html/swagger"
rm_path=$swagger_docs_dest'/*.*'
rm $rm_path
# generate swagger docs
mvn -pl jaas clean test
# copy swagger docs
if [ ! -f ${swagger_html_path} ]; then
echo "File $swagger_html_path not found!"
else
if [ ! -d ${swagger_docs_dest} ]; then
mkdir ${swagger_docs_dest}
fi
echo "Copying $swagger_html_path to $swagger_docs_dest..."
cp ${swagger_html_path} ${swagger_docs_dest}/swagger_doc.html
fi
if [ ! -f ${swagger_pdf_path} ]; then
echo "File $swagger_pdf_path not found!"
else
if [ ! -d ${swagger_docs_dest} ]; then
mkdir ${swagger_docs_dest}
fi
echo "Copying $swagger_pdf_path to $swagger_docs_dest..."
cp ${swagger_pdf_path} ${swagger_docs_dest}/swagger_doc.pdf
fi
else
echo "- Swagger documentation generation skipped"
fi # with swagger
# copy docu for later usage by gh-pages branch script
if [ ! -z "$version" ]; then
echo "Docu copy for version '$version' is created"
cp -r ./doc/html ./doc_$version
fi