Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
12fa8ceed240a1bff5fa32413ddc16391748278a
[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' -a -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' -a -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     (echo -n "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 "List of missing references:"
42 for f in $( (grep '<name>' build/xml/msg_8h.xml; \
43              grep '<name>' build/xml/namespacesimgrid_1_1s4u.xml; \
44              grep '<innerclass refid=' build/xml/namespacesimgrid_1_1s4u.xml ; \
45             ) | sed 's/<[^>]*>//g' | sort )
46 do
47
48   if grep $f source/*rst | grep -q '.. doxygen[^::]*:: '"$f"'$' ||
49      grep $f source/*rst | grep -q '.. doxygen[^::]*:: simgrid::[^:]*::[^:]*::'"$f"'$'  ; then :   
50 #    echo "$f documented"
51   else 
52     if grep -q $f ignored_symbols ; then : 
53 #      echo "$f ignored" # not documented
54     else
55       echo "$f"
56     fi
57   fi
58 done
59
60 set +e
61 if [ -e /opt/simgrid ] ; then chmod +x /opt/simgrid; fi