Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Constify pointer and reference local variables in src/surf/.
[simgrid.git] / docs / Build.sh
1 #! /bin/sh
2 #
3 # Simplistic script to rebuild our documentation with sphinx-build
4
5 # If you are missing some dependencies, try: pip3 install --requirement docs/requirements.txt
6
7 # Python needs to find simgrid on my machine, but not ctest -- sorry for the hack
8 if [ -e /opt/simgrid ] ; then chmod +x /opt/simgrid; fi
9
10 set -e
11
12 if [ "x$1" != 'xdoxy' ] && [ -e build/xml ] ; then
13   echo "Doxygen not rerun: 'doxy' was not provided as an argument"
14 else
15   rm -rf build/xml source/api/
16   cd source; doxygen; cd ..
17 fi
18
19 if [ "x$1" != 'xjava' ] && [ -e source/java ] ; then
20   echo "javasphinx not rerun: 'java' was not provided as an argument"
21 else
22   rm -rf source/java
23   javasphinx-apidoc --force -o source/java/ ../src/bindings/java/org/simgrid/msg
24   rm -f source/java/packages.rst # api_generated/source_java_packages.rst
25   rm -f source/java/org/simgrid/msg/package-index.rst # api_generated/source_java_org_simgrid_msg_package-index.rst
26   for f in source/java/org/simgrid/msg/* ; do
27     # Add the package name to the page titles
28     (printf "class org.simgrid.msg."; cat $f )>tmp
29     mv tmp $f
30     sed -i 's/==/========================/' $f # That's the right length knowing that I add 'class org.simgrid.msg.'
31   done
32 #  sed -i 's/^.. java:type:: public class /.. java:type:: public class org.simgrid.msg/' source/java/org/simgrid/msg/*
33   echo "javasphinx relaunched"
34 fi
35
36 PYTHONPATH=../lib sphinx-build -M html source build ${SPHINXOPTS}
37
38 set +x
39
40 perl -pe 's/(xlink:href="(?:http|.*\.html))/target="_top" $1/' \
41      source/img/graphical-toc.svg > build/html/graphical-toc.svg
42
43 echo
44 echo "Undocumented examples:"
45 for ex in $( (cd .. ; \
46               find examples/s4u/ -name '*.cpp'; \
47               find examples/python -name '*.py'; \
48              ) | sort )
49 do
50     if grep -q "example-tab:: $ex" ../examples/README.rst ; then :
51 #        echo "found example-tab:: $ex"
52     elif grep -q "showfile:: $ex" ../examples/README.rst ; then :
53     else
54         echo $ex
55     fi
56 done
57
58 set +e # Don't fail
59 if [ -e /usr/bin/linkchecker ] ; then
60     linkchecker --no-status -o csv --ignore-url='.*\.css$' --ignore-url=build/html/_modules  --ignore-url=public/java/org build/html \
61      | grep -v '^#' \
62      | grep -v 'urlname;parentname;baseref;result;warningstring'
63   echo "done."
64 else
65   echo "Install linkchecker to have it executed when you build the doc."
66 fi
67