Use LinkableValueNode members functions when possible in the derived valuenodes.
[synfig.git] / autobuild / api.sh
1 #!/bin/sh
2 #
3 # Script to generate API documentation and send it to sf.net
4 #
5 # Copyright 2009-2010 Konstantin Dmitriev
6 # Copyright 2010 Carlos López
7 #
8 # This program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License as
10 # published by the Free Software Foundation; either version 2 of
11 # the License, or (at your option) any later version.
12 #
13 # This script has been redesigned to be used in a cron work.
14 # Adapt the following macros to the proper directories values.
15
16 export HTMLDIR=$HOME/synfig/synfig-repository/api
17 export SOURCEDIR=$HOME/synfig/synfig-repository/code/synfig
18
19 set -e
20
21 #check for git and doxygen
22 if ! which git > /dev/null 2>&1; then
23         echo "Please install git."
24         exit
25 fi
26 if ! which doxygen > /dev/null 2>&1; then
27         echo "Please install doxygen."
28         exit
29 fi
30
31 #fetching sources
32 if [ ! -d $SOURCEDIR ]; then
33         mkdir -p `dirname $SOURCEDIR`
34         cd `dirname $SOURCEDIR`
35         git clone --depth 1 git://synfig.git.sourceforge.net/gitroot/synfig/synfig `basename $SOURCEDIR`
36 fi
37
38 mkdir -p $HTMLDIR
39
40 cd $SOURCEDIR
41 git fetch
42 git checkout remotes/origin/master
43
44 #generating api to htmldir
45 for module in ETL synfig-core synfig-studio; do
46 cd $module
47 echo "Generating API for $module..."
48 case $module in
49         ETL)
50                 MODULETITLE='Extended Template Library'
51                 ;;
52         synfig-core)
53                 MODULETITLE='Synfig Core'
54                 ;;
55         synfig-studio)
56                 MODULETITLE='Synfig Studio'
57                 ;;
58 esac
59         VERSION=`cat configure.ac |egrep "AC_INIT\(\[$MODULETITLE\],"| sed "s|.*$MODULETITLE\],\[||" | sed "s|\],\[.*||"`
60         VERSION=${VERSION#*\'}
61         VERSION=${VERSION%\'}
62 cp -f doxygen.cfg.in doxygen.cfg
63 sed -i "s/@VERSION@/$VERSION/" doxygen.cfg
64 sed -i "s/@PACKAGE@/$module/" doxygen.cfg
65 doxygen doxygen.cfg
66 rm -rf $HTMLDIR/$module
67 mv doc/html $HTMLDIR/$module
68 cp $SOURCEDIR/$module/doxygen.cfg $HTMLDIR/$module
69 cd ..
70 done
71
72 #index.html
73 DATE=`date -R`
74 cat > $HTMLDIR/index.html <<EOF
75 <html><head><title>ETL, synfig, synfigstudio API docs</title></head>
76 <body>
77 <h1>ETL, synfig, synfigstudio API docs</h1>
78 <ul>
79 <li><a href="ETL/index.html">ETL</a></li>
80 <li><a href="synfig-core/index.html">synfig-core</a></li>
81 <li><a href="synfig-studio/index.html">synfig-studio</a></li>
82 </ul>
83 <p>Generated on: $DATE.</p>
84 </body></html>
85 EOF
86