Files
MySensors/Documentation/doxygen.sh
rstephan 93db0e1e68 Removed local plantuml.jar file (#1467)
* Find a local plantuml installation

Search the usual location for the jar file and use it instead.
It will work for debian/ubuntu, fedora and arch.

* Nicer layout for the dev-env readme

* Optional tools to make the docs

What's needed to generate the documentation.
How to run it.

* plantuml.jar removed

No need to keep a local copy of the jar-file.
doxygen.sh will find a version, if installed from the package manager.

* Added homebrew support for plantuml
2025-11-17 17:56:06 +02:00

53 lines
1.8 KiB
Bash
Executable File

#!/bin/bash
## Invoke from project root, e.g Documentation/doxygen.sh
result=0
. .mystools/.bundle_runtime.sh
is_installed "doxygen" || err "doxygen not found!"
is_installed "java" || err "java not found!"
# Find plantuml.jar. Using "which plantuml" is possible but we need the .jar file anyway.
JAR_LIST=(/usr/share/java/plantuml.jar /usr/share/plantuml/plantuml.jar /usr/share/java/plantuml/plantuml.jar /usr/local/Cellar/plantuml/1.2021.1/libexec/plantuml.jar)
for jar in "${JAR_LIST[@]}" ; do
if [ -f $jar ] ; then
export PLANTUML_JAR_PATH=$jar
break
fi
done
[ "$PLANTUML_JAR_PATH" != "" ] || err "plantuml not found!"
# Generate doxygen file for Raspberry Pi configure command
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
./configure --help >> configure.h
echo -e "@endverbatim\n@}*/\n" >> configure.h
# Generate version information
export PROJECTNUMBER=$(git fetch --tags; git describe --tags;)
# Generate any UML diagrams in the code tree that has the proper tags
java -Djava.awt.headless=true -jar $PLANTUML_JAR_PATH -failfast2 -nbthread auto -o "$PWD/Documentation/img" "./**.(c|cpp|dox|h|hpp|ino)"
# Launch Doxygen (assumed to be in the PATH)
doxygen
# Show any warnings created
cat doxygen.log
# Check for defines that occur multiple times
multiple_defines=$(for file in Documentation/html/*.html; do grep -e 'memname' $file | grep 'define MY_' | cut -f2 -d'#'| cut -f1 -d'<' | awk '{ print $2 }' | sort | uniq -c | grep -v '1 MY_'; done)
if [ -n "$multiple_defines" ]; then
echo "The following defines occur more than once:"
echo $multiple_defines
result=1
else
echo "No defines occur more than once - great!"
fi
# Clean up autogenerated (temporary) artifacts
rm configure.h
exit $result