Blame autobuild/api.sh

2dad27
#!/bin/sh
2dad27
#
2dad27
# Script to generate API documentation and send it to sf.net
2dad27
#
Carlos Lopez f1d8c5
# Copyright 2009-2010 Konstantin Dmitriev
Carlos Lopez e83454
# Copyright 2010, 2013 Carlos Lรณpez
2dad27
#
2dad27
# This program is free software; you can redistribute it and/or
2dad27
# modify it under the terms of the GNU General Public License as
2dad27
# published by the Free Software Foundation; either version 2 of
2dad27
# the License, or (at your option) any later version.
Carlos Lopez f1d8c5
#
Carlos Lopez f1d8c5
# This script has been redesigned to be used in a cron work.
Carlos Lopez f1d8c5
# Adapt the following macros to the proper directories values.
2dad27
Carlos Lopez f1d8c5
export HTMLDIR=$HOME/synfig/synfig-repository/api
b6eac5
#export SOURCEDIR=$HOME/synfig/synfig-repository/code/synfig
b6eac5
export SOURCEDIR=$HOME/synfig/synfig-repository/api/tmp/synfig
2dad27
2dad27
set -e
2dad27
d7342f
#check for git and doxygen
d7342f
if ! which git > /dev/null 2>&1; then
d7342f
	echo "Please install git."
d7342f
	exit
d7342f
fi
d7342f
if ! which doxygen > /dev/null 2>&1; then
d7342f
	echo "Please install doxygen."
d7342f
	exit
d7342f
fi
d7342f
d7342f
#fetching sources
2dad27
if [ ! -d $SOURCEDIR ]; then
2dad27
	mkdir -p `dirname $SOURCEDIR`
2dad27
	cd `dirname $SOURCEDIR`
Carlos Lopez e83454
	git clone --depth 1 git://github.com/synfig/synfig.git `basename $SOURCEDIR`
2dad27
fi
2dad27
2dad27
mkdir -p $HTMLDIR
2dad27
2dad27
cd $SOURCEDIR
2dad27
git fetch
b6eac5
git reset --hard
2dad27
git checkout remotes/origin/master
2dad27
d7342f
#generating api to htmldir
2dad27
for module in ETL synfig-core synfig-studio; do
Carlos Lopez f1d8c5
cd $module
d7342f
echo "Generating API for $module..."
Carlos Lopez f1d8c5
case $module in
Carlos Lopez f1d8c5
	ETL)
Carlos Lopez f1d8c5
		MODULETITLE='Extended Template Library'
Carlos Lopez f1d8c5
		;;
Carlos Lopez f1d8c5
	synfig-core)
Carlos Lopez f1d8c5
		MODULETITLE='Synfig Core'
Carlos Lopez f1d8c5
		;;
Carlos Lopez f1d8c5
	synfig-studio)
Carlos Lopez f1d8c5
		MODULETITLE='Synfig Studio'
Carlos Lopez f1d8c5
		;;
Carlos Lopez f1d8c5
esac
Carlos Lopez f1d8c5
	VERSION=`cat configure.ac |egrep "AC_INIT\(\[$MODULETITLE\],"| sed "s|.*$MODULETITLE\],\[||" | sed "s|\],\[.*||"`
Carlos Lopez f1d8c5
	VERSION=${VERSION#*\'}
Carlos Lopez f1d8c5
	VERSION=${VERSION%\'}
2dad27
cp -f doxygen.cfg.in doxygen.cfg
2dad27
sed -i "s/@VERSION@/$VERSION/" doxygen.cfg
2dad27
sed -i "s/@PACKAGE@/$module/" doxygen.cfg
2dad27
doxygen doxygen.cfg
2dad27
rm -rf $HTMLDIR/$module
2dad27
mv doc/html $HTMLDIR/$module
Carlos Lopez f1d8c5
cp $SOURCEDIR/$module/doxygen.cfg $HTMLDIR/$module
Carlos Lopez f1d8c5
cd ..
2dad27
done
2dad27
2dad27
#index.html
2dad27
DATE=`date -R`
2dad27
cat > $HTMLDIR/index.html <
2dad27
<title>ETL, synfig, synfigstudio API docs</title>
2dad27
2dad27

ETL, synfig, synfigstudio API docs

2dad27
    749a39
  • ETL
  • 749a39
  • synfig-core
  • 749a39
  • synfig-studio
  • 2dad27
    2dad27

    Generated on: $DATE.

    2dad27
    2dad27
    EOF
    2dad27