Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
RegionSnap: only use pointers to regions for sake of simplicity
[simgrid.git] / docs / Build.sh
1 #! /bin/sh
2 #
3 # Simplistic script to rebuild our documentation with sphinx-build
4
5 set -e
6
7 if [ "x$1" != 'xdoxy' -a -e build/xml ] ; then
8   echo "Doxygen not rerun: 'doxy' was not provided as an argument"
9 else
10   rm -rf build/xml source/api/
11   cd source; doxygen; cd ..
12 fi
13
14 if [ "x$1" != 'xjava' -a -e source/java ] ; then
15   echo "javasphinx not rerun: 'java' was not provided as an argument"
16 else
17   rm -rf source/java
18   javasphinx-apidoc --force -o source/java/ ../src/bindings/java/org/simgrid/msg
19   rm -f source/java/packages.rst # api_generated/source_java_packages.rst
20   rm -f source/java/org/simgrid/msg/package-index.rst # api_generated/source_java_org_simgrid_msg_package-index.rst
21   for f in source/java/org/simgrid/msg/* ; do
22     # Add the package name to the page titles
23     (echo -n "class org.simgrid.msg."; cat $f )>tmp
24     mv tmp $f
25     sed -i 's/==/========================/' $f # That's the right length knowing that I add 'class org.simgrid.msg.'
26   done
27 #  sed -i 's/^.. java:type:: public class /.. java:type:: public class org.simgrid.msg/' source/java/org/simgrid/msg/*
28   echo "javasphinx relaunched"
29 fi
30
31 PYTHONPATH=../lib sphinx-build -M html source build ${SPHINXOPTS}
32
33 set +x
34
35 perl -pe 's/(xlink:href="(?:http|.*\.html))/target="_top" $1/' \
36      source/img/graphical-toc.svg > build/html/graphical-toc.svg
37
38 echo "List of missing references:"
39 for f in $( (grep '<name>' build/xml/msg_8h.xml; \
40              grep '<name>' build/xml/namespacesimgrid_1_1s4u.xml; \
41              grep '<innerclass refid=' build/xml/namespacesimgrid_1_1s4u.xml ; \
42             ) | sed 's/<[^>]*>//g' | sort )
43 do
44
45   if grep $f source/*rst | grep -q '.. doxygen[^::]*:: '"$f"'$' ||
46      grep $f source/*rst | grep -q '.. doxygen[^::]*:: simgrid::[^:]*::[^:]*::'"$f"'$'  ; then :   
47 #    echo "$f documented"
48   else 
49     if grep -q $f ignored_symbols ; then : 
50 #      echo "$f ignored" # not documented
51     else
52       echo "$f"
53     fi
54   fi
55 done