Logo AND Algorithmique Numérique Distribuée

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