LayerManagement: Added script to generate specification document
authorTimo Lotterbach <timo.lotterbach@bmw-carit.de>
Thu, 9 Feb 2012 08:58:00 +0000 (09:58 +0100)
committerTimo Lotterbach <timo.lotterbach@bmw-carit.de>
Thu, 16 Feb 2012 08:40:18 +0000 (09:40 +0100)
Since the doxygen generator can not be configured to leave out some parts of the
documentation (e.g. Class Documentation), a script was created to create
the desired documentation. The Script:
- create the html and latex documentation using doxygen
- patch the latex files to exclude the unnecessary sections of the document
- create the pdf version with correct file name

generate_specification.sh [new file with mode: 0755]

diff --git a/generate_specification.sh b/generate_specification.sh
new file mode 100755 (executable)
index 0000000..28d5403
--- /dev/null
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+LATEX_PATH=./doc_generated/latex
+PDF_NAME=GENIVI_LayerManagement_Design_v2_0_MG0001
+
+echo "starting doxygen."
+echo "generating html and latex documentation..."
+doxygen
+
+# doxygen will generate more section of the document
+# than neccessary for the specififcation document.
+# This processing step removes the unneccessary sections
+# from the main latex file, so they won't be included in
+# the resulting PDF file.
+echo "patching latex main document..."
+MAIN_PAGE=`cat $LATEX_PATH/refman.tex`
+echo "$MAIN_PAGE" \
+    | grep -Ev "{struct|{class" \
+    | grep -Ev "printindex" \
+    | grep -Ev "{action}|{LayerManagement Command Action Overview}" \
+    | grep -Ev "{frequency}|{LayerManagement Command Frequency Overview}" \
+    | grep -Ev "{Class Documentation}" \
+> $LATEX_PATH/refman.tex
+
+echo "creating PDF from latex documentation."
+cd $LATEX_PATH
+make &> /dev/null
+cd -
+
+echo "applying name to PDF document..."
+cp $LATEX_PATH/refman.pdf ./$PDF_NAME.pdf
+
+echo "The LayerManagement specification was stored here:"
+echo "`pwd`/$PDF_NAME.pdf"
+