3 # Script to generate API documentation and send it to sf.net
5 # Copyright 2009-2010 Konstantin Dmitriev
6 # Copyright 2010 Carlos López
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.
13 # This script has been redesigned to be used in a cron work.
14 # Adapt the following macros to the proper directories values.
16 export HTMLDIR=$HOME/synfig/synfig-repository/api
17 export SOURCEDIR=$HOME/synfig/synfig-repository/code/synfig
21 #check for git and doxygen
22 if ! which git > /dev/null 2>&1; then
23 echo "Please install git."
26 if ! which doxygen > /dev/null 2>&1; then
27 echo "Please install doxygen."
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`
42 git checkout remotes/origin/master
44 #generating api to htmldir
45 for module in ETL synfig-core synfig-studio; do
47 echo "Generating API for $module..."
50 MODULETITLE='Extended Template Library'
53 MODULETITLE='Synfig Core'
56 MODULETITLE='Synfig Studio'
59 VERSION=`cat configure.ac |egrep "AC_INIT\(\[$MODULETITLE\],"| sed "s|.*$MODULETITLE\],\[||" | sed "s|\],\[.*||"`
60 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
66 rm -rf $HTMLDIR/$module
67 mv doc/html $HTMLDIR/$module
68 cp $SOURCEDIR/$module/doxygen.cfg $HTMLDIR/$module
74 cat > $HTMLDIR/index.html <<EOF
75 <html><head><title>ETL, synfig, synfigstudio API docs</title></head>
77 <h1>ETL, synfig, synfigstudio API docs</h1>
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>
83 <p>Generated on: $DATE.</p>