ceph/admin/build-doc
Noah Watkins e225767384 doc: add JavaDoc to Sphinx
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2012-10-26 10:28:50 -07:00

72 lines
1.7 KiB
Bash
Executable File

#!/bin/sh
set -e
cd "$(dirname "$0")"
cd ..
TOPDIR=`pwd`
install -d -m0755 build-doc
if command -v dpkg >/dev/null; then
for package in python-dev python-pip python-virtualenv doxygen ditaa ant; do
if [ "$(dpkg --status -- $package|sed -n 's/^Status: //p')" != "install ok installed" ]; then
# add a space after old values
missing="${missing:+$missing }$package"
fi
done
if [ -n "$missing" ]; then
echo "$0: missing required packages, please install them:" 1>&2
echo "sudo apt-get install $missing"
exit 1
fi
else
for command in virtualenv doxygen ditaa ant; do
if ! command -v "$command" >/dev/null; then
# add a space after old values
missing="${missing:+$missing }$package"
fi
done
if [ -n "$missing" ]; then
echo "$0: missing required command, please install them:" 1>&2
echo "$missing"
exit 1
fi
fi
if [ ! -e build-doc/doxygen/xml ]; then
doxygen
fi
cat src/osd/PG.h src/osd/PG.cc | doc/scripts/gen_state_diagram.py > doc/dev/peering_graph.generated.dot
cd build-doc
[ -z "$vdir" ] && vdir="./virtualenv"
if [ ! -e $vdir ]; then
virtualenv --no-site-packages $vdir
fi
$vdir/bin/pip install --quiet -r ../admin/doc-requirements.txt
install -d -m0755 \
output/html \
output/man
PYTHONPATH=`pwd`/../src/pybind $vdir/bin/sphinx-build -a -b dirhtml -d doctrees ../doc output/html
$vdir/bin/sphinx-build -a -b man -d doctrees ../doc output/man
#
# Build and install JavaDocs
#
JAVADIR=$TOPDIR/src/java
# Clean and build JavaDocs
rm -rf $JAVADIR/doc
ant -buildfile $JAVADIR/build.xml docs
# Create clean target directory
JAVA_OUTDIR=output/html/api/libcephfs-java/javadoc
rm -rf $JAVA_OUTDIR
mkdir $JAVA_OUTDIR
# Copy JavaDocs to target directory
cp -a $JAVADIR/doc/* $JAVA_OUTDIR/