blob: c95c2d0366a654f0f3c85985271c30cc6da5adbd [file] [log] [blame]
epoger@google.comb0c5e072011-12-06 14:52:38 +00001#!/bin/bash
2#
epoger@google.com338ef652011-12-07 18:52:40 +00003# Runs doxygen and stores its results in the skia-autogen repo, so that they
4# can be browsed at http://skia-autogen.googlecode.com/svn/docs/html/index.html
epoger@google.comb0c5e072011-12-06 14:52:38 +00005
6# Prepare a temporary dir and check out Skia trunk and docs.
7cd
8TEMPDIR=/tmp/skia-doxygen
9rm -rf $TEMPDIR
10mkdir -p $TEMPDIR
11cd $TEMPDIR
12svn checkout http://skia.googlecode.com/svn/trunk # read-only
epoger@google.com338ef652011-12-07 18:52:40 +000013svn checkout https://skia-autogen.googlecode.com/svn/docs # writeable
epoger@google.comb0c5e072011-12-06 14:52:38 +000014
15# Run Doxygen.
16cd trunk
17doxygen Doxyfile
18cd ../docs
19
20# Add any newly created files to Subversion.
21NEWFILES=$(svn status | grep ^\? | awk '{print $2}')
22if [ -n "$NEWFILES" ]; then
23 svn add $NEWFILES
24fi
25
26# We haven't updated the timestamp footer yet... if there are no changes
27# yet, just exit. (We'll wait until there are any actual doc changes before
28# updating the timestamp and committing changes to the repository.)
29MODFILES=$(svn status | grep ^[AM])
30if [ -z "$MODFILES" ]; then
31 echo "No documentation updates, exiting early."
32 exit 0
33fi
34
35# Update the timestamp footer.
36cat >iframe_footer.html <<EOF
37<html><body>
38<address style="text-align: right;"><small>
39Generated on $(date) for skia by
40<a href="http://www.doxygen.org/index.html">doxygen</a>
41$(doxygen --version) </small></address>
42</body></html>
43EOF
44
45# Make sure that all files have the correct mimetype.
epoger@google.com338ef652011-12-07 18:52:40 +000046find . -name '*.html' -exec svn propset svn:mime-type text/html '{}' \;
47find . -name '*.css' -exec svn propset svn:mime-type text/css '{}' \;
48find . -name '*.js' -exec svn propset svn:mime-type text/javascript '{}' \;
49find . -name '*.gif' -exec svn propset svn:mime-type image/gif '{}' \;
50find . -name '*.png' -exec svn propset svn:mime-type image/png '{}' \;
epoger@google.comb0c5e072011-12-06 14:52:38 +000051
52# Commit the updated docs to the subversion repo.
53svn commit --message 'commit doxygen-generated documentation'