diff --git a/apidox/src/frameworksgendox.sh b/apidox/src/frameworksgendox.sh deleted file mode 100755 index 23da7aa..0000000 --- a/apidox/src/frameworksgendox.sh +++ /dev/null @@ -1,178 +0,0 @@ -#! /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=https://doc.qt.io/qt-5 - export QTDOCTAG=$TAGPATH/5.2 - export QTHELPGENERATOR=/usr/lib64/qt5/bin/qhelpgenerator - DOXYSH=/home/api/kapidox/src/kapidox_generate - test -s "$DOXYSH" || { echo "*** NO KAPIDOX" ; exit ; } - ;; - * ) - export QTDOCDIR=https://doc.qt.io/archives/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.... - if [ $frameworksGen -eq 1 ] ; then - rm -rf $TEMPPATH/* - else - rm -rf $TEMPPATH/$module-* - rm -f $TEMPPATH/$module.tar.gz $TEMPPATH/$module.log - fi - - # 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 \ - --qtdoc-dir $TAGPATH/5.2 \ - --qtdoc-link $QTDOCDIR \ - --qtdoc-flatten-links \ - --qhp \ - --qhelpgenerator $QTHELPGENERATOR \ - --depdiagram-dot-dir $HOME/depdiagram-output/ \ - $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 diff --git a/apidox/src/gendox.sh b/apidox/src/gendox.sh index 224ff22..fd8a421 100755 --- a/apidox/src/gendox.sh +++ b/apidox/src/gendox.sh @@ -1,136 +1,132 @@ #! /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.... case "$VERSION" in kde-3.5) export QTDOCDIR=http://doc.qt.digia.com/3.3 export QTDOCTAG=$TAGPATH/qt3.3.tag ;; - frameworks* ) - export QTDOCDIR=http://qt-project.org/doc/qt-5.1 - export QTDOCTAG=$TAGPATH/qt5.1.tag - ;; * ) export QTDOCDIR=https://doc.qt.io/archives/qt-4.8 export QTDOCTAG=$TAGPATH/qt4.8.tag ;; esac # Generate the documentation for each module found for i in $MODULES; do if [ $VERBOSE ]; then echo "** Generating APIDOX for $SRCPATH/$i" fi # Cleanup from previous generations.... rm -rf $TEMPPATH/$i-* rm -f $TEMPPATH/$i.tar.gz $TEMPPATH/$i.log # Make sure the sources for this module exist... test -d "$SRCPATH/$i" || { echo "$SRCPATH/$i does not exist, skipping" ; continue ; } # Build the documentation! DOXARGS="$SRCPATH/$i" if [ $VERBOSE ]; then echo ** Running $DOXYSH --installdir=$TEMPPATH \ --doxdatadir=$DOXDATAPATH \ --title=\""$title"\" \ --api-searchbox --no-cleanup --preprocess \ $DOXARGS fi # Using doxygen > 1.8.10 broke the mainpage.dox links: we explicitely ask for 1.8.7 export PATH=$HOME/doxygen-1.8.7/bin:$PATH #pick up our local doxygen build sh $DOXYSH \ --installdir=$TEMPPATH \ --doxdatadir=$DOXDATAPATH \ --title="$title" \ --api-searchbox \ --no-cleanup \ --preprocess \ $DOXARGS 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 > "$i.new" mv "$i.new" "$i.log" # If we need to, log the number of errors.... if [ $VERBOSE ]; then AMT=`grep ^$SRCPATH $i.log | wc -l` expr 0 + "$AMT" > /dev/null 2>&1 || AMT="0" echo "** Number of errors: $AMT" echo "** Number of applications: " `grep 'Creating apidox' "$i.log" | wc -l` echo "** Written to $i.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 ( cd $TEMPPATH; tar czf $i.tar.gz $i-apidocs ) # Move the temporary output to the real apidocs location rm -rf $OUTPATH/$i-* mv -f $TEMPPATH/$i-* $OUTPATH rm -f $OUTPATH/$i.tar.gz mv -f $TEMPPATH/$i.tar.gz $OUTPATH rm -f $LOGPATH/$i.log mv -f $TEMPPATH/$i.log $LOGPATH done if [ $VERBOSE ]; then echo "* APIDOX Generation complete" fi diff --git a/apidox/src/kapidoxgendox.sh b/apidox/src/kapidoxgendox.sh new file mode 100755 index 0000000..4a59262 --- /dev/null +++ b/apidox/src/kapidoxgendox.sh @@ -0,0 +1,104 @@ +#! /bin/bash +VERBOSE=1 + +# Read arguments... +test "x--quiet" = "x$1" && { shift ; VERBOSE=0 ; } + +# Configuration +# APIPATH: top-level for API stuff +APIPATH=/srv/www/api.kde.org +# OUTPATH: where the final output goes +OUTPATH=$APIPATH/apidocs/apidox-frameworks +# TEMPPATH: where the temporary output goes +TEMPPATH=/srv/tmp/tempdocs/apidox-kapidox +# TAGPATH: where tag files (i.e, qtX.Y.tag) reside +TAGPATH=$HOME/quality-kde-org/apidox/data +# TOPSRC: where the top-level KDE source code resides +TOPSRC=/srv/sources +# LOGPATH: where logs get moved +LOGPATH=/srv/logs/api/kapidox + +# 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 "$TOPSRC" || { echo "No source path $TOPSRC" ; exit 1 ; } +cd "$TEMPPATH" || { echo "Cannot cd into $TEMPPATH" ; exit 1 ; } + +# Log it... +if [ $VERBOSE ]; then + echo "* Generating APIDOX for $TOPSRC with kapidox" +fi + +# Specify url and path to Qt documentation.... +QTDOCLINK=https://doc.qt.io/qt-5 +QTDOCTAGSDIR=$TAGPATH/5.2 +QTHELPGENERATOR=/usr/lib64/qt5/bin/qhelpgenerator +DOXYGEN=$HOME/doxygen-src/bin/doxygen +DOXYSH=/home/api/kapidox/src/kapidox_generate +test -s "$DOXYSH" || { echo "*** NO KAPIDOX" ; exit ; } +DEPDIAGRAMDOTDIR=$HOME/depdiagram-output/ + +# Cleanup from previous generations.... +rm -rf $TEMPPATH/* + +# Set the command that does the dox generation +DOXCMD="$DOXYSH \ + --doxygen $DOXYGEN \ + --qtdoc-dir $QTDOCTAGSDIR \ + --qtdoc-link $QTDOCLINK \ + --qtdoc-flatten-links \ + --qhp \ + --qhelpgenerator $QTHELPGENERATOR \ + --depdiagram-dot-dir $DEPDIAGRAMDOTDIR \ + $TOPSRC" + +# 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 > "../kapidox.log.new" +CMDRESULT=$PIPESTATUS +# If not 0 (= failure) +if [ $CMDRESULT -ne 0 ] ; then + echo " ** FATAL ERROR during script: not updated. **" >> "../kapidox.log.new" +fi +mv "../kapidox.log.new" "kapidox.log" + +# If we need to, log the number of errors.... +if [ $VERBOSE ]; then + AMT=`grep ^$TOPSRC kapidox.log | wc -l` + expr 0 + "$AMT" > /dev/null 2>&1 || AMT="0" + echo "** Number of errors: $AMT" + echo "** Number of applications: " `grep 'Creating apidox' "kapidox.log" | wc -l` + echo "** Written to kapidox.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 +( cd $TEMPPATH; tar czf kapidox.tar.gz . ) + +# Move the temporary output to the real apidocs location +rm -f $LOGPATH/kapidox.log +cat $TEMPPATH/kapidox.log | grep -v "INFO " > $LOGPATH/kapidox.log +# Move only if result is 0 (success) +if [ $CMDRESULT -eq 0 ] ; then + if [ -d $OUTPATH/frameworks5-apidocs ]; then + rm -rf $OUTPATH/frameworks5-apidocs/* + else + mkdir -p $OUTPATH/frameworks5-apidocs + fi + mv -f $TEMPPATH/* $OUTPATH/frameworks5-apidocs +else + echo "** Got an error somewhere, code not moved" +fi + +if [ $VERBOSE ]; then + echo "* APIDOX Generation complete" +fi diff --git a/tools/update-apidox b/tools/update-apidox index 358508e..ef24bba 100755 --- a/tools/update-apidox +++ b/tools/update-apidox @@ -1,48 +1,39 @@ #! /bin/sh TOPSRC=/srv/sources TOP_QSRC=$HOME/quality-kde-org TOPAPI=/srv/www/api.kde.org BINPATH=$HOME/bin BRANCH="4.14" # Copy in Mainpage.dox for some modules branches="kde-4.x kde-$BRANCH" modules="kdeaccessibility kdeedu kdegraphics kdenetwork kdesdk kdeutils" for b in $branches do for m in $modules do cp -f $TOP_QSRC/website/api.kde.org/Mainpages/$m.dox $TOPSRC/$b/$m/Mainpage.dox done done -branches="frameworks" -modules="frameworks5" -for b in $branches -do - for m in $modules - do - cp -f $TOP_QSRC/website/api.kde.org/Mainpages/frameworks.dox $TOPSRC/frameworks/$m/Mainpage.dox - done -done #Use doxygen via gendox.sh to do the build of the work. $BINPATH/gendox.sh --version kde-4.x & $BINPATH/gendox.sh --version kde-"$BRANCH" & -$BINPATH/frameworksgendox.sh --version frameworks frameworks5 & +$BINPATH/kapidoxgendox.sh & wait $BINPATH/gendox.sh --version extragear & $BINPATH/gendox.sh --version bundled-apps & wait $BINPATH/gendox.sh --version kdesupport & $BINPATH/gendox.sh --version kdereview & $BINPATH/gendox.sh --version playground & wait #Make sure the "stable" and "unstable" links are in place ( cd $TOPAPI; rm -f unstable; ln -s 4.x-api unstable ) ( cd $TOPAPI; rm -f stable; ln -s "$BRANCH"-api stable ) exit