File: api.sh

package info (click to toggle)
synfig 1.5.1%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 59,132 kB
  • sloc: cpp: 109,639; sh: 6,121; makefile: 1,458; csh: 243; perl: 238; python: 124; ruby: 73
file content (88 lines) | stat: -rw-r--r-- 2,304 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/sh
#
# Script to generate API documentation and send it to sf.net
#
# Copyright 2009-2010 Konstantin Dmitriev
# Copyright 2010, 2013 Carlos López
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# This script has been redesigned to be used in a cron work.
# Adapt the following macros to the proper directories values.

export HTMLDIR=$HOME/synfig/synfig-repository/api
#export SOURCEDIR=$HOME/synfig/synfig-repository/code/synfig
export SOURCEDIR=$HOME/synfig/synfig-repository/api/tmp/synfig

set -e

#check for git and doxygen
if ! which git > /dev/null 2>&1; then
	echo "Please install git."
	exit
fi
if ! which doxygen > /dev/null 2>&1; then
	echo "Please install doxygen."
	exit
fi

#fetching sources
if [ ! -d $SOURCEDIR ]; then
	mkdir -p `dirname $SOURCEDIR`
	cd `dirname $SOURCEDIR`
	git clone --depth 1 git://github.com/synfig/synfig.git `basename $SOURCEDIR`
fi

mkdir -p $HTMLDIR

cd $SOURCEDIR
git fetch
git reset --hard
git checkout remotes/origin/master

#generating api to htmldir
for module in ETL synfig-core synfig-studio; do
cd $module
echo "Generating API for $module..."
case $module in
	ETL)
		MODULETITLE='Extended Template Library'
		;;
	synfig-core)
		MODULETITLE='Synfig Core'
		;;
	synfig-studio)
		MODULETITLE='Synfig Studio'
		;;
esac
	VERSION=`cat configure.ac |egrep "AC_INIT\(\[$MODULETITLE\],"| sed "s|.*$MODULETITLE\],\[||" | sed "s|\],\[.*||"`
	VERSION=${VERSION#*\'}
	VERSION=${VERSION%\'}
cp -f doxygen.cfg.in doxygen.cfg
sed -i "s/@VERSION@/$VERSION/" doxygen.cfg
sed -i "s/@PACKAGE@/$module/" doxygen.cfg
doxygen doxygen.cfg
rm -rf $HTMLDIR/$module
mv doc/html $HTMLDIR/$module
cp $SOURCEDIR/$module/doxygen.cfg $HTMLDIR/$module
cd ..
done

#index.html
DATE=`date -R`
cat > $HTMLDIR/index.html <<EOF
<html><head><title>ETL, synfig, synfigstudio API docs</title></head>
<body>
<h1>ETL, synfig, synfigstudio API docs</h1>
<ul>
<li><a href="ETL/annotated.html">ETL</a></li>
<li><a href="synfig-core/annotated.html">synfig-core</a></li>
<li><a href="synfig-studio/annotated.html">synfig-studio</a></li>
</ul>
<p>Generated on: $DATE.</p>
</body></html>
EOF