annotate extra/soundsoftware/extract-doxygen.sh @ 203:1e55195bca45 feature_20

Pull doc extractor script out into separate javadoc, doxygen, and controller scripts
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Mon, 07 Feb 2011 16:46:28 +0000
parents
children c3544e9fd588
rev   line source
chris@203 1 #!/bin/bash
chris@203 2
chris@203 3 hgdir="/var/hg"
chris@203 4 docdir="/var/doc"
chris@203 5
chris@203 6 project="$1"
chris@203 7 targetdir="$2"
chris@203 8
chris@203 9 projectdir="$hgdir/$project"
chris@203 10
chris@203 11 if [ -z "$project" ] || [ -z "$targetdir" ]; then
chris@203 12 echo "Usage: $0 <project> <targetdir>"
chris@203 13 exit 2
chris@203 14 fi
chris@203 15
chris@203 16 if [ ! -d "$projectdir" ] || [ ! -d "$projectdir/.hg" ]; then
chris@203 17 echo "No hg repo found at $projectdir"
chris@203 18 exit 1
chris@203 19 fi
chris@203 20
chris@203 21 if [ ! -d "$targetdir" ]; then
chris@203 22 echo "Target dir $targetdir not found"
chris@203 23 exit 1
chris@203 24 fi
chris@203 25
chris@203 26 if [ -f "$targetdir/index.html" ]; then
chris@203 27 echo "Target dir $targetdir already contains index.html"
chris@203 28 exit 1
chris@203 29 fi
chris@203 30
chris@203 31 doxyfile=$(find "$projectdir" -type f -name Doxyfile -print | head -1)
chris@203 32
chris@203 33 if [ -z "$doxyfile" ]; then
chris@203 34 echo "No Doxyfile found for project $project"
chris@203 35 exit 1
chris@203 36 fi
chris@203 37
chris@203 38 echo "Project $project contains a Doxyfile at $doxyfile"
chris@203 39
chris@203 40 cd "$projectdir" || exit 1
chris@203 41
chris@203 42 # hmm. should be a whitelist
chris@203 43
chris@203 44 cat "$doxyfile" | \
chris@203 45 grep -vi OUTPUT_DIRECTORY | \
chris@203 46 grep -vi HTML_OUTPUT | \
chris@203 47 grep -vi SEARCHENGINE | \
chris@203 48 grep -vi HAVE_DOT | \
chris@203 49 grep -vi DOT_FONTNAME | \
chris@203 50 grep -vi DOT_FONTPATH | \
chris@203 51 grep -vi DOT_TRANSPARENT | \
chris@203 52 sed -e '$a OUTPUT_DIRECTORY='"$targetdir" \
chris@203 53 -e '$a HTML_OUTPUT = .' \
chris@203 54 -e '$a SEARCHENGINE = NO' \
chris@203 55 -e '$a HAVE_DOT = YES' \
chris@203 56 -e '$a DOT_FONTNAME = FreeMono' \
chris@203 57 -e '$a DOT_FONTPATH = /usr/share/fonts/truetype/freefont' \
chris@203 58 -e '$a DOT_TRANSPARENT = YES' | \
chris@203 59 doxygen -
chris@203 60