changeset 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 170b8a96b213
children f9357455ac96
files extra/soundsoftware/extract-javadoc.sh
diffstat 1 files changed, 37 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/extra/soundsoftware/extract-javadoc.sh	Tue Feb 01 16:43:25 2011 +0000
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+# Run this script from /var/doc/<project-name>
+
+# Find Hg repo and update it
+
+docdir=$(pwd)
+name=$(basename $(pwd))
+hgdir="/var/hg/$name"
+echo "Extracting doc for $name"
+if [ ! -d "$hgdir" ]; then
+   echo "Error: No $hgdir found for project $name"
+   exit 1
+fi
+( cd "$hgdir" ; hg update ) || exit 1
+
+# Identify either a Doxyfile or some Java packages
+
+# TODO: Doxyfile
+
+
+# This is very rough; check what is actually permitted for package
+# declarations
+
+java_packages=`find "$hgdir" -type f -name \*.java -print | \
+     xargs grep -h '^ *package [a-zA-Z][a-zA-Z0-9\._-]* *; *' | sort | uniq | \
+     sed -e 's/^ *package //' -e 's/ *; *$//'`
+
+echo "This project contains java packages:"
+echo "$java_packages"
+
+# This won't work if code is in a subdir, e.g. src/com/example/project/Hello.java
+
+javadoc -sourcepath "$hgdir" -d . -subpackages $java_packages -verbose
+
+# If we have just written something to a doc directory that was
+# previously empty, we should switch on Embedded for this project