comparison extra/soundsoftware/extract-javadoc.sh @ 168:c1e9f2dab1d5 feature_75

* Start on script for extracting Doxygen/Javadoc
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Tue, 01 Feb 2011 16:43:25 +0000
parents
children 2cec5c53cd68
comparison
equal deleted inserted replaced
167:170b8a96b213 168:c1e9f2dab1d5
1 #!/bin/sh
2
3 # Run this script from /var/doc/<project-name>
4
5 # Find Hg repo and update it
6
7 docdir=$(pwd)
8 name=$(basename $(pwd))
9 hgdir="/var/hg/$name"
10 echo "Extracting doc for $name"
11 if [ ! -d "$hgdir" ]; then
12 echo "Error: No $hgdir found for project $name"
13 exit 1
14 fi
15 ( cd "$hgdir" ; hg update ) || exit 1
16
17 # Identify either a Doxyfile or some Java packages
18
19 # TODO: Doxyfile
20
21
22 # This is very rough; check what is actually permitted for package
23 # declarations
24
25 java_packages=`find "$hgdir" -type f -name \*.java -print | \
26 xargs grep -h '^ *package [a-zA-Z][a-zA-Z0-9\._-]* *; *' | sort | uniq | \
27 sed -e 's/^ *package //' -e 's/ *; *$//'`
28
29 echo "This project contains java packages:"
30 echo "$java_packages"
31
32 # This won't work if code is in a subdir, e.g. src/com/example/project/Hello.java
33
34 javadoc -sourcepath "$hgdir" -d . -subpackages $java_packages -verbose
35
36 # If we have just written something to a doc directory that was
37 # previously empty, we should switch on Embedded for this project