diff --git a/apidox/src/frameworksgendox.sh b/apidox/src/frameworksgendox.sh index 0dc24d0..c113dfd 100755 --- a/apidox/src/frameworksgendox.sh +++ b/apidox/src/frameworksgendox.sh @@ -1,172 +1,172 @@ #! /bin/bash VERBOSE=1 VERSION="" # Read arguments... test "x--quiet" = "x$1" && { shift ; VERBOSE=0 ; } test "x--version" = "x$1" && { shift ; VERSION="$1" ; shift ; } test -z "$VERSION" && { echo "No version given"; exit 1 ; } # Configuration # APIPATH: top-level for API stuff APIPATH=/srv/www/api.kde.org # OUTPATH: where the final output goes OUTPATH=$APIPATH/apidocs/apidox-$VERSION # TEMPPATH: where the temporary output goes TEMPPATH=/srv/tmp/tempdocs/apidox-$VERSION # TAGPATH: where tag files (i.e, qtX.Y.tag) reside TAGPATH=$HOME/quality-kde-org/apidox/data # BINPATH: where the helper programs (i.e. doxylog2html.pl) reside BINPATH=/home/api/bin # SRCPREFIX: where the top-level KDE source code resides SRCPREFIX=/srv/sources # LOGPATH: where logs get moved LOGPATH=/srv/logs/api/$VERSION # SRCPATH: where the source code for this component resides SRCPATH=$SRCPREFIX/$VERSION # DOXYHOME: where the doxygen stuff livs DOXYHOME=$HOME/kdelibs/doc DOXYSH=$DOXYHOME/api/doxygen.sh test -s "$DOXYSH" || { echo "*** NO DOXYGEN.SH" ; exit ; } DOXDATAPATH=$DOXYHOME/common # Determine the modules we need to build the documentation of... MODULES=`ls $SRCPATH` # If argument given, use it as modules list to run test -n "$1" && MODULES="$1" # Prepare to run.... test -d "$OUTPATH" || { echo "No path $OUTPATH -- creating it" ; mkdir -p $OUTPATH || exit 1 ; } test -d "$TEMPPATH" || { echo "No path $TEMPPATH -- creating it" ; mkdir -p $TEMPPATH || exit 1 ; } test -d "$LOGPATH" || { echo "No path $LOGPATH -- creating it" ; mkdir -p $LOGPATH || exit 1 ; } test -d "$SRCPATH" || { echo "No source path $SRCPATH" ; exit 1 ; } cd "$TEMPPATH" || { echo "Cannot cd into $TEMPPATH" ; exit 1 ; } # Make a nice title component=`echo $VERSION | sed s/kde-// | sed s/kde// | sed 's/^[a-z]/\U&/'` title="KDE $component API Reference" # Log it... if [ $VERBOSE ]; then echo "* Generating APIDOX for $VERSION" echo "* Title \"$title\"" fi # Specify url and path to Qt documentation.... frameworksGen=0 case "$VERSION" in kde-3.5) export QTDOCDIR=http://doc.qt.digia.com/3.3 export QTDOCTAG=$TAGPATH/qt3.3.tag ;; frameworks* ) frameworksGen=1 export QTDOCDIR=http://qt-project.org/doc/qt-5.2 export QTDOCTAG=$TAGPATH/5.2 DOXYSH=/home/api/kapidox/src/kapidox_generate test -s "$DOXYSH" || { echo "*** NO KAPIDOX" ; exit ; } ;; * ) export QTDOCDIR=http://qt-project.org/doc/qt-4.8 export QTDOCTAG=$TAGPATH/qt4.8.tag ;; esac # Generate the documentation for each module found for module in $MODULES; do if [ $VERBOSE ]; then echo "** Generating APIDOX for $SRCPATH/$module" fi # Cleanup from previous generations.... rm -rf $TEMPPATH/$module-* rm -f $TEMPPATH/$module.tar.gz $TEMPPATH/$module.log # Make sure the sources for this module exist... test -d "$SRCPATH/$module" || { echo "$SRCPATH/$module does not exist, skipping" ; continue ; } # Set the command that does the dox generation if [ $frameworksGen -eq 1 ] ; then DOXCMD="$DOXYSH \ --doxygen $HOME/doxygen-src/bin/doxygen \ - --api-searchbox \ --qtdoc-dir $TAGPATH/5.2 \ --qtdoc-link $QTDOCDIR \ --qtdoc-flatten-links \ + --qhp --depdiagram-dot-dir $HOME/dependency-information/ \ $SRCPATH/.." else DOXCMD="$DOXYSH \ --installdir=$TEMPPATH \ --doxdatadir=$DOXDATAPATH \ --title=\"$title\" \ --api-searchbox \ --no-cleanup \ --preprocess \ $SRCPATH/$module" fi # Build the documentation! if [ $VERBOSE ]; then echo "** Running $DOXCMD" fi $DOXCMD 2>&1 \ | grep -v '^Error: Unexpected tag `' \ | grep -v '^[Ww]arning: ignoring unsupported tag' \ | grep -v '^[Ww]arning: ignoring unknown tag' \ | sed s+/tempdocs/+/apidocs/+g > "$module.new" CMDRESULT=$PIPESTATUS # If not 0 (= failure) if [ $CMDRESULT -ne 0 ] ; then echo " ** FATAL ERROR during script: not updated. **" >> "$module.new" fi mv "$module.new" "$module.log" # If we need to, log the number of errors.... if [ $VERBOSE ]; then AMT=`grep ^$SRCPATH $module.log | wc -l` expr 0 + "$AMT" > /dev/null 2>&1 || AMT="0" echo "** Number of errors: $AMT" echo "** Number of applications: " `grep 'Creating apidox' "$module.log" | wc -l` echo "** Written to $module.log" fi # clean-up unneeded files ( cd $TEMPPATH; find . -name "*.map" -o -name "*.md5" | xargs rm -f ) # create one big tar file of all the goodies if [ $frameworksGen -eq 1 ] ; then ( cd $TEMPPATH; tar czf $module.tar.gz . ) else ( cd $TEMPPATH; tar czf $module.tar.gz $module-apidocs ) fi # Move the temporary output to the real apidocs location if [ $frameworksGen -eq 1 ] ; then rm -f $LOGPATH/$module.log cat $TEMPPATH/$module.log | grep -v "INFO " > $LOGPATH/$module.log # Move only if result is 0 (success) if [ $CMDRESULT -eq 0 ] ; then if [ -d $OUTPATH/$module-apidocs ]; then rm -rf $OUTPATH/$module-apidocs/* else mkdir -p $OUTPATH/$module-apidocs fi mv -f $TEMPPATH/* $OUTPATH/$module-apidocs else echo "** Got an error somewhere, code not moved" fi else rm -rf $OUTPATH/$module-* mv -f $TEMPPATH/$module-* $OUTPATH rm -f $OUTPATH/$module.tar.gz mv -f $TEMPPATH/$module.tar.gz $OUTPATH rm -f $LOGPATH/$module.log mv -f $TEMPPATH/$module.log $LOGPATH fi done if [ $VERBOSE ]; then echo "* APIDOX Generation complete" fi