Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 85 lines (68 sloc) 2.234 kb
a2cf69b @bwmcadams - Added documentation build script
bwmcadams authored
1 #!/bin/sh
f3f195f @rozza Updated buildDocs.sh
rozza authored
2 usage()
3 {
4 cat << EOF
5 usage: $0 options
6
7 This script generates the casbah documentation
8
9 OPTIONS:
10 -h Show this message
11 -g Auto update the gh-pages branch
12 EOF
13 }
14
15 GHPAGES=false
16 while getopts "h:g" OPTION
17 do
18 case $OPTION in
19 h)
20 usage
21 exit 1
22 ;;
23 g)
24 GHPAGES=$OPTARG
25 ;;
26 ?)
27 usage
28 exit
29 ;;
30 esac
31 done
a2cf69b @bwmcadams - Added documentation build script
bwmcadams authored
32
027aaa2 @rozza Updated to latest sxr
rozza authored
33 SCALA=2.10
134c15b @rozza Documentation updates
rozza authored
34 WEBSITE_ROOT=mongodb.github.com/casbah/
acb911d @rozza Doc updates
rozza authored
35 SPHINX_DIR=./src/sphinx
36 SITE_DIR=./target/site/
a2cf69b @bwmcadams - Added documentation build script
bwmcadams authored
37
1a55863 @rozza Update to doc build process
rozza authored
38 ./sbt ++2.10.4 "update" "clean" "compile" "make-site" "unidoc"
a2cf69b @bwmcadams - Added documentation build script
bwmcadams authored
39
acb911d @rozza Doc updates
rozza authored
40 mkdir -p $SITE_DIR/api.sxr/casbah-commons
41 mkdir -p $SITE_DIR/api.sxr/casbah-core
42 mkdir -p $SITE_DIR/api.sxr/casbah-gridfs
43 mkdir -p $SITE_DIR/api.sxr/casbah-query
a2cf69b @bwmcadams - Added documentation build script
bwmcadams authored
44
acb911d @rozza Doc updates
rozza authored
45 cp ./casbah-commons/target/scala-$SCALA/classes.sxr/* $SITE_DIR/api.sxr/casbah-commons
46 cp ./casbah-core/target/scala-$SCALA/classes.sxr/* $SITE_DIR/api.sxr/casbah-core
47 cp ./casbah-gridfs/target/scala-$SCALA/classes.sxr/* $SITE_DIR/api.sxr/casbah-gridfs
48 cp ./casbah-query/target/scala-$SCALA/classes.sxr/* $SITE_DIR/api.sxr/casbah-query
962e5e3 @bwmcadams UPdated doc build including single Scaladoc buildout
bwmcadams authored
49
acb911d @rozza Doc updates
rozza authored
50 touch $SITE_DIR/.nojekyll
962e5e3 @bwmcadams UPdated doc build including single Scaladoc buildout
bwmcadams authored
51
2ac0918 @rozza Fixes for documentation
rozza authored
52 # Remove double slashes
65a0b40 @rozza Update buildDocs.sh
rozza authored
53 find $SITE_DIR/api/ -name \*html -exec sed -i "" 's#.sxr//#.sxr/#g' {} \;
11c73d1 @rozza Updated docs to sbt-site
rozza authored
54 # Update the sxr in url
65a0b40 @rozza Update buildDocs.sh
rozza authored
55 find $SITE_DIR/api/ -name \*html -exec sed -i "" 's#/src\(.*\)/\(.*scala.html\)#/\2#' {} \;
11c73d1 @rozza Updated docs to sbt-site
rozza authored
56 # Update WEBSITE ROUTE
65a0b40 @rozza Update buildDocs.sh
rozza authored
57 find $SITE_DIR/api/ -name \*html -exec sed -i "" "s#/{{WEBSITE_ROOT}}#/$WEBSITE_ROOT#g" {} \;
acb911d @rozza Doc updates
rozza authored
58
59 # Make pdf / epub
a3d037f @rozza Putting html back into the docs
rozza authored
60 make -C $SPHINX_DIR clean html epub latexpdf
acb911d @rozza Doc updates
rozza authored
61
62 cp $SPHINX_DIR/_build/epub/CasbahMongoDBScalaToolkitDocumentation.epub $SITE_DIR/CasbahDocumentation.epub
c175cb7 @rozza Updated docs build script
rozza authored
63 cp $SPHINX_DIR/_build/latex/CasbahDocumentation.pdf $SITE_DIR/CasbahDocumentation.pdf
64
027aaa2 @rozza Updated to latest sxr
rozza authored
65 echo " ========== "
66 echo " Docs built "
67 echo " ========== "
68
f3f195f @rozza Updated buildDocs.sh
rozza authored
69 if $GHPAGES && git diff-index --quiet HEAD --; then
c175cb7 @rozza Updated docs build script
rozza authored
70 echo " ========================== "
dbdffa0 @rozza Docs shell script fix for OSX
rozza authored
71 echo " Updating 'gh-pages' branch"
c175cb7 @rozza Updated docs build script
rozza authored
72 echo " ========================== "
73
74 git co gh-pages
75 mv target .target
dbdffa0 @rozza Docs shell script fix for OSX
rozza authored
76 rm -rf *
a1b93e9 @rozza Fix docs build
rozza authored
77 cp -R .target/site/* .
bd9904c @rozza Updated buildDocs
rozza authored
78 mv .target target
c175cb7 @rozza Updated docs build script
rozza authored
79
80 echo " Please check the new docs and checkin ..."
f3f195f @rozza Updated buildDocs.sh
rozza authored
81 elif $GHPAGES; then
c175cb7 @rozza Updated docs build script
rozza authored
82 echo "You have changes not checked-in - cannot automatically update gh-pages"
83 fi
84
Something went wrong with that request. Please try again.