comparison extra/soundsoftware/extract-javadoc.sh @ 178:2cec5c53cd68 feature_20

* Another minor stylesheet update, start hacking around with Doxyfiles
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Wed, 02 Feb 2011 17:04:56 +0000
parents c1e9f2dab1d5
children 3a353bd04976
comparison
equal deleted inserted replaced
174:97d27ad3df50 178:2cec5c53cd68
16 16
17 # Identify either a Doxyfile or some Java packages 17 # Identify either a Doxyfile or some Java packages
18 18
19 # TODO: Doxyfile 19 # TODO: Doxyfile
20 20
21 doxyfile=`find "$hgdir" -type f -name Doxyfile -print | head -1`
22
23 echo "This project contains a Doxyfile:"
24 echo "$doxyfile"
25
26 if [ -z "$doxyfile" ]; then
27 echo "No Doxyfile: skipping"
28 else
29
30 # hmm. should be a whitelist
31
32 ( cd "$hgdir" && grep -vi OUTPUT_DIRECTORY "$doxyfile" | grep -vi HTML_OUTPUT | sed -e '$a OUTPUT_DIRECTORY='"$docdir" -e '$a HTML_OUTPUT = .' | doxygen - )
33
34 fi
21 35
22 # This is very rough; check what is actually permitted for package 36 # This is very rough; check what is actually permitted for package
23 # declarations 37 # declarations
24 38
25 java_packages=`find "$hgdir" -type f -name \*.java -print | \ 39 java_packages=`find "$hgdir" -type f -name \*.java -print | \
26 xargs grep -h '^ *package [a-zA-Z][a-zA-Z0-9\._-]* *; *' | sort | uniq | \ 40 xargs grep -h '^ *package [a-zA-Z][a-zA-Z0-9\._-]* *; *' | \
27 sed -e 's/^ *package //' -e 's/ *; *$//'` 41 sort | uniq | \
42 sed -e 's/^ *package //' -e 's/ *; *$//'`
28 43
29 echo "This project contains java packages:" 44 echo "This project contains Java packages:"
30 echo "$java_packages" 45 echo "$java_packages"
31 46
32 # This won't work if code is in a subdir, e.g. src/com/example/project/Hello.java 47 if [ -z "$java_packages" ]; then
48 echo "No Java packages: skipping"
49 exit 0
50 fi
51
52 # This won't work if code is in a subdir,
53 # e.g. src/com/example/project/Hello.java
54
55 # We need to convert the package name back to a path, and check
56 # whether that matches the tail of the path to a java file that
57 # declares itself to be in that package... but we don't have that list
58 # of java files to hand here... hm
33 59
34 javadoc -sourcepath "$hgdir" -d . -subpackages $java_packages -verbose 60 javadoc -sourcepath "$hgdir" -d . -subpackages $java_packages -verbose
35 61
36 # If we have just written something to a doc directory that was 62 # If we have just written something to a doc directory that was
37 # previously empty, we should switch on Embedded for this project 63 # previously empty, we should switch on Embedded for this project