Permalink
Browse files

- Added documentation build script

  • Loading branch information...
1 parent 805251b commit a2cf69bbed930f0d50d26fccce898199c0ef14de @bwmcadams bwmcadams committed Nov 8, 2010
Showing with 44 additions and 5 deletions.
  1. +24 −0 buildDocs.sh
  2. +15 −0 doc_index.html
  3. +5 −5 project/build/CasbahProject.scala
View
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+rm -rf docs
+mkdir -p docs/casbah-commons
+mkdir -p docs/casbah-core
+mkdir -p docs/casbah-gridfs
+mkdir -p docs/casbah-query
+
+sbt "update" "clean" "doc"
+
+cp -R casbah-commons/target/scala_2.8.0/classes.sxr docs/casbah-commons/sxr
+cp -R casbah-commons/target/scala_2.8.0/doc/main/api docs/casbah-commons/api
+cp -R casbah-core/target/scala_2.8.0/classes.sxr docs/casbah-core/sxr
+cp -R casbah-core/target/scala_2.8.0/doc/main/api docs/casbah-core/api
+cp -R casbah-gridfs/target/scala_2.8.0/classes.sxr docs/casbah-gridfs/sxr
+cp -R casbah-gridfs/target/scala_2.8.0/doc/main/api docs/casbah-gridfs/api
+cp -R casbah-query/target/scala_2.8.0/classes.sxr docs/casbah-query/sxr
+cp -R casbah-query/target/scala_2.8.0/doc/main/api docs/casbah-query/api
+
+cp doc_index.html docs/index.html
+
+cd docs
+perl -p -i -e 's#http://api.mongodb.org/scala/casbah/source.sxr/.*(casbah-.*)/src/main/scala#http://api.mongodb.org/scala/casbah/\1/sxr#gi' `find ./ -name \*.html`
+
View
@@ -0,0 +1,15 @@
+<html>
+ <head>
+ <title>MongoDB Casbah Scala Documentation</title>
+ </head>
+ <body>
+ Casbah consists of several modules. Which documentation do you want?
+ <ul>
+ <li><a href="casbah-commons/api/index.html">casbah-commons</a> Utilities to improve working with Scala and MongoDB together without dependencies on anything but the MongoDB Java Driver and ScalaJ-Collection. This includes Scala Collections 2.8 compatible wrappers for DBList and DBObject as well as type conversion facilities to simplify the use of Scala types with MongoDB (and register your own custom types)</li>
+ <li><a href="casbah-query/api/index.html">casbah-query</a> The Query DSL; provides an internal Scala DSL for querying MongoDB using native, MongoDB syntax operators. This only depends upon Commons and can be used standalone without the rest of Casbah.</li>
+ <li><a href="casbah-core/api/index.html">casbah-core</a> The wrappers for interacting directly with MongoDB providing more Scala-like interactions. It depends upon both Commons and Query as well as ScalaTime for use of JodaTime (which we prefer over JDK date but you are welcome to use JDK Dates).</li>
+ <li><a href="casbah-gridfs/api/index.html">casbah-gridfs</a> This provides enhancement wrappers to GridFS including loan pattern support. It is dependent on Core (and by transitive property, Commons & Query as well) but is not included in Core - you must explicitly load if it you want to use GridFS.</li>
+ </ul>
+
+ </body>
+</html>
@@ -31,16 +31,16 @@ class CasbahProject(info: ProjectInfo)
/**
* SXR Support
*/
- //val sxr = compilerPlugin("org.scala-tools.sxr" % "sxr_2.8.0" % "0.2.6")
+ val sxr = compilerPlugin("org.scala-tools.sxr" % "sxr_2.8.0" % "0.2.6")
override def compileOptions =
+ CompileOption("-P:sxr:base-directory:" + mainScalaSourcePath) ::
super.compileOptions ++ Seq(Unchecked, ExplainTypes, Deprecation)
- //CompileOption("-P:sxr:base-directory:" + mainScalaSourcePath.absolutePath) ::
override def documentOptions = Seq(
- CompoundDocOption("-doc-source-url", "http://api.mongodb.org/scala/casbah/source.sxr/")
- ) ++ super.documentOptions
-
+ CompoundDocOption("-doc-source-url", "http://api.mongodb.org/scala/casbah/source.sxr/"),
+ CompoundDocOption("-d", mainScalaSourcePath.toString)
+ )
// Testing Deps
val specs = "org.scala-tools.testing" % "specs_2.8.0" % "1.6.5" % "test->default"
val scalatest = "org.scalatest" % "scalatest" % "1.2-for-scala-2.8.0.final-SNAPSHOT" % "test"

0 comments on commit a2cf69b

Please sign in to comment.