Skip to content

Commit 356b783

Browse files
fallbergmfalkvidd
authored andcommitted
Script documentation generation and UML support (#992)
Documentation is now generated by invoking a shell script which takes care of all the plumbing. There is now also support of inlineing PlantUML syntax with Doxygen. This inlining takes the form of @startuml{imagename.png} 'PlantUML specific syntax' @enduml The inlineing can be made in C syntax comment blocks. Doxygen will then include the generated UML diagram when rendering the HTML documentation. All generated images will be placed under Documentation/img which is the default search path for Doxygen.
1 parent 1f8d810 commit 356b783

File tree

6 files changed

+39
-18
lines changed

6 files changed

+39
-18
lines changed

.ci/doxygen.groovy

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,9 @@
11
#!groovy
22
def call(config) {
33
config.pr.setBuildStatus(config, 'PENDING', 'Toll gate (Documentation)', 'Generating...', '${BUILD_URL}flowGraphTable/')
4-
// Generate doxygen file for Raspberry Pi configure command
5-
sh """#!/bin/bash +x
4+
sh """#!/bin/bash
65
cd ${config.repository_root}
7-
echo -e "/**\n * @defgroup RaspberryPiGateway Raspberry Pi Gateway\n * @ingroup MyConfigGrp\n * @brief Configuration options for the Raspberry Pi Gateway\n@{\n@verbatim" > configure.h
8-
grep -A999 '<<EOF' configure | grep -B999 EOF | grep -v 'EOF' >> configure.h
9-
echo -e "@endverbatim\n@}*/\n" >> configure.h"""
10-
sh """#!/bin/bash +x
11-
cd ${config.repository_root}
12-
export PROJECTNUMBER=\$(
13-
if [[ \$(git rev-parse --abbrev-ref HEAD) == "master" ]]; then
14-
git describe --tags ;
15-
else
16-
git rev-parse --short HEAD ;
17-
fi
18-
)
19-
echo 'WARN_LOGFILE=doxygen.log' >> Doxyfile && doxygen"""
6+
Documentation/doxygen.sh"""
207
warnings canComputeNew: false, canResolveRelativePaths: false,
218
defaultEncoding: '',
229
excludePattern: '''.*/sha204_library\\.h,.*/drivers/Linux/.*,.*/cores/esp8266/.*,hardware/.*''',

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
*.xml text
1111
*.lua text
1212

13-
1413
# Denote all files that are truly binary and should not be modified.
1514
*.png binary
1615
*.jpg binary
@@ -20,3 +19,4 @@
2019
*.svg binary
2120
*.woff binary
2221
*.epg binary
22+
*.jar binary

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ build
99
bin
1010
*.sublime-workspace
1111
.idea
12+
doxygen.log

Documentation/doxygen.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
## Invoke from project root, e.g Documentation/doxygen.sh
3+
4+
# Generate doxygen file for Raspberry Pi configure command
5+
echo -e "/**\n * @defgroup RaspberryPiGateway Raspberry Pi Gateway\n * @ingroup MyConfigGrp\n * @brief Configuration options for the Raspberry Pi Gateway\n@{\n@verbatim" > configure.h
6+
grep -A999 '<<EOF' configure | grep -B999 EOF | grep -v 'EOF' >> configure.h
7+
echo -e "@endverbatim\n@}*/\n" >> configure.h
8+
9+
# Generate version information
10+
export PROJECTNUMBER=$(
11+
if [[ $(git rev-parse --abbrev-ref HEAD) == "master" ]]; then
12+
git describe --tags ;
13+
else
14+
git rev-parse --short HEAD ;
15+
fi
16+
)
17+
18+
# Generate any UML diagrams in the code tree that has the proper tags
19+
export PLANTUML_JAR_PATH=Documentation/plantuml.jar
20+
java -Djava.awt.headless=true -jar $PLANTUML_JAR_PATH -failfast2 -nbthread auto -o "$PWD/Documentation/img" "./**.(c|cpp|dox|h|hpp|ino)"
21+
22+
# Launch Doxygen (assumed to be in the PATH)
23+
doxygen
24+
25+
# Show any warnings created
26+
cat doxygen.log
27+
28+
# Clean up autogenerated (temporary) artifacts
29+
rm configure.h

Documentation/plantuml.jar

8.99 MB
Binary file not shown.

Doxyfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ TAB_SIZE = 4
220220
# "Side Effects:". You can put \n's in the value part of an alias to insert
221221
# newlines.
222222

223-
ALIASES =
223+
ALIASES = "startuml{1}=\image html \1\n\image latex \1\n\if DontIgnorePlantUMLCode"
224+
ALIASES += "enduml=\endif"
224225

225226
# This tag can be used to specify a number of word-keyword mappings (TCL only).
226227
# A mapping has the form "name=value". For example adding "class=itcl::class"
@@ -731,7 +732,7 @@ WARN_FORMAT = "$file:$line: $text"
731732
# messages should be written. If left blank the output is written to standard
732733
# error (stderr).
733734

734-
WARN_LOGFILE =
735+
WARN_LOGFILE = doxygen.log
735736

736737
#---------------------------------------------------------------------------
737738
# Configuration options related to the input files
@@ -2289,3 +2290,6 @@ GENERATE_LEGEND = YES
22892290
# This tag requires that the tag HAVE_DOT is set to YES.
22902291

22912292
DOT_CLEANUP = YES
2293+
2294+
# PlantUML executable
2295+
PLANTUML_JAR_PATH = $(PLANTUML_JAR_PATH)

0 commit comments

Comments
 (0)