epoger@google.com | b0c5e07 | 2011-12-06 14:52:38 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
epoger@google.com | 338ef65 | 2011-12-07 18:52:40 +0000 | [diff] [blame] | 3 | # 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.com | b0c5e07 | 2011-12-06 14:52:38 +0000 | [diff] [blame] | 5 | |
| 6 | # Prepare a temporary dir and check out Skia trunk and docs. |
| 7 | cd |
| 8 | TEMPDIR=/tmp/skia-doxygen |
| 9 | rm -rf $TEMPDIR |
| 10 | mkdir -p $TEMPDIR |
| 11 | cd $TEMPDIR |
| 12 | svn checkout http://skia.googlecode.com/svn/trunk # read-only |
epoger@google.com | 338ef65 | 2011-12-07 18:52:40 +0000 | [diff] [blame] | 13 | svn checkout https://skia-autogen.googlecode.com/svn/docs # writeable |
epoger@google.com | b0c5e07 | 2011-12-06 14:52:38 +0000 | [diff] [blame] | 14 | |
| 15 | # Run Doxygen. |
| 16 | cd trunk |
| 17 | doxygen Doxyfile |
| 18 | cd ../docs |
| 19 | |
| 20 | # Add any newly created files to Subversion. |
| 21 | NEWFILES=$(svn status | grep ^\? | awk '{print $2}') |
| 22 | if [ -n "$NEWFILES" ]; then |
| 23 | svn add $NEWFILES |
| 24 | fi |
| 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.) |
| 29 | MODFILES=$(svn status | grep ^[AM]) |
| 30 | if [ -z "$MODFILES" ]; then |
| 31 | echo "No documentation updates, exiting early." |
| 32 | exit 0 |
| 33 | fi |
| 34 | |
| 35 | # Update the timestamp footer. |
| 36 | cat >iframe_footer.html <<EOF |
| 37 | <html><body> |
| 38 | <address style="text-align: right;"><small> |
| 39 | Generated on $(date) for skia by |
| 40 | <a href="http://www.doxygen.org/index.html">doxygen</a> |
| 41 | $(doxygen --version) </small></address> |
| 42 | </body></html> |
| 43 | EOF |
| 44 | |
| 45 | # Make sure that all files have the correct mimetype. |
epoger@google.com | 338ef65 | 2011-12-07 18:52:40 +0000 | [diff] [blame] | 46 | find . -name '*.html' -exec svn propset svn:mime-type text/html '{}' \; |
| 47 | find . -name '*.css' -exec svn propset svn:mime-type text/css '{}' \; |
| 48 | find . -name '*.js' -exec svn propset svn:mime-type text/javascript '{}' \; |
| 49 | find . -name '*.gif' -exec svn propset svn:mime-type image/gif '{}' \; |
| 50 | find . -name '*.png' -exec svn propset svn:mime-type image/png '{}' \; |
epoger@google.com | b0c5e07 | 2011-12-06 14:52:38 +0000 | [diff] [blame] | 51 | |
| 52 | # Commit the updated docs to the subversion repo. |
| 53 | svn commit --message 'commit doxygen-generated documentation' |