This repository has been archived by the owner on Jan 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
1,570 additions
and
291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
.cache | ||
.classpath | ||
.DS_Store | ||
.history | ||
.idea | ||
.lib | ||
.project | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
site.settings | ||
|
||
site.includeScaladoc() | ||
|
||
site.sphinxSupport() | ||
|
||
site.sphinxSupport() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,23 @@ | ||
#!/bin/sh | ||
|
||
rm -rf docs/scaladoc casbah-core/scaladocBuild/ | ||
SCALA=2.9.2 | ||
WEBSITE_ROOT=rozza.github.com/casbah/ | ||
|
||
./.sbt "+update" "+clean" "+doc" "+all-docs" | ||
./sbt "update" "clean" "make-site" "unidoc" | ||
|
||
cp -R casbah-core/scaladocBuild docs/scaladoc | ||
mkdir -p ./target/site/api.sxr/casbah-commons | ||
mkdir -p ./target/site/api.sxr/casbah-core | ||
mkdir -p ./target/site/api.sxr/casbah-gridfs | ||
mkdir -p ./target/site/api.sxr/casbah-query | ||
|
||
mkdir -p docs/scaladoc/modules/casbah-commons | ||
mkdir -p docs/scaladoc/modules/casbah-core | ||
mkdir -p docs/scaladoc/modules/casbah-gridfs | ||
mkdir -p docs/scaladoc/modules/casbah-query | ||
cp ./casbah-commons/target/scala-$SCALA/classes.sxr/* ./target/site/api.sxr/casbah-commons | ||
cp ./casbah-core/target/scala-$SCALA/classes.sxr/* ./target/site/api.sxr/casbah-core | ||
cp ./casbah-gridfs/target/scala-$SCALA/classes.sxr/* ./target/site/api.sxr/casbah-gridfs | ||
cp ./casbah-query/target/scala-$SCALA/classes.sxr/* ./target/site/api.sxr/casbah-query | ||
|
||
cp -R casbah-commons/target/scala_2.9.0-1/classes.sxr docs/scaladoc/modules/casbah-commons/sxr | ||
cp -R casbah-commons/target/scala_2.9.0-1/doc/main/api docs/scaladoc/modules/casbah-commons/api | ||
cp -R casbah-core/target/scala_2.9.0-1/classes.sxr docs/scaladoc/modules/casbah-core/sxr | ||
cp -R casbah-core/target/scala_2.9.0-1/doc/main/api docs/scaladoc/modules/casbah-core/api | ||
cp -R casbah-gridfs/target/scala_2.9.0-1/classes.sxr docs/scaladoc/modules/casbah-gridfs/sxr | ||
cp -R casbah-gridfs/target/scala_2.9.0-1/doc/main/api docs/scaladoc/modules/casbah-gridfs/api | ||
cp -R casbah-query/target/scala_2.9.0-1/classes.sxr docs/scaladoc/modules/casbah-query/sxr | ||
cp -R casbah-query/target/scala_2.9.0-1/doc/main/api docs/scaladoc/modules/casbah-query/api | ||
touch ./target/site/.nojekyll | ||
|
||
cp doc_index.html docs/scaladoc/modules/index.html | ||
|
||
cd tutorial_src | ||
|
||
make clean html #epub latexpdf | ||
|
||
#cp build/epub/CasbahMongoDBScalaToolkitDocumentation.epub ../docs/CasbahDocumentation.epub | ||
#cp build/latex/CasbahDocumentation.pdf ../docs/CasbahDocumentation.pdf | ||
cp -R build/html/* ../docs | ||
|
||
cd .. | ||
|
||
cd docs/scaladoc | ||
perl -p -i -e 's#a href="http://api.mongodb.org/scala/casbah-(.*)/casbah-(.*)/sxr/.*/casbah-\2/src/main/scala/(.*)"#a href="/scala/casbah/\1/scaladoc/modules/casbah-\2/sxr/\3.scala.html"#gi' `find ./ -name \*.html` | ||
perl -p -i -e 's#a href="http://api.mongodb.org/scala/casbah-(.*)/casbah-casbah-core/sxr/.*/casbah-(.*)/src/main/scala/(.*)"#a href="/scala/casbah/\1/scaladoc/modules/casbah-\2/sxr/\3.scala.html"#gi' `find ./ -name \*.html` | ||
# Update the sxr in url | ||
find ./target/site/api/ -name \*html -exec sed -i 's#/src\(.*\)/\(.*scala.html\)#\2#' {} \; | ||
# Update WEBSITE ROUTE | ||
find ./target/site/api/ -name \*html -exec sed -i "s#/{{WEBSITE_ROOT}}#/$WEBSITE_ROOT#g" {} \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import sbt._ | ||
import Keys._ | ||
import Project.Initialize | ||
|
||
/** Borrowed from https://github.com/akka/akka/blob/master/project/Unidoc.scala */ | ||
object Unidoc { | ||
val unidocDirectory = SettingKey[File]("unidoc-directory") | ||
val unidocExclude = SettingKey[Seq[String]]("unidoc-exclude") | ||
val unidocAllSources = TaskKey[Seq[Seq[File]]]("unidoc-all-sources") | ||
val unidocSources = TaskKey[Seq[File]]("unidoc-sources") | ||
val unidocAllClasspaths = TaskKey[Seq[Classpath]]("unidoc-all-classpaths") | ||
val unidocClasspath = TaskKey[Seq[File]]("unidoc-classpath") | ||
val unidoc = TaskKey[File]("unidoc", "Create unified scaladoc for all aggregates") | ||
|
||
lazy val settings: Seq[Project.Setting[_]] = Seq( | ||
unidocDirectory <<= crossTarget / "../site/api", | ||
unidocExclude := Seq.empty, | ||
unidocAllSources <<= (thisProjectRef, buildStructure, unidocExclude) flatMap allSources, | ||
unidocSources <<= unidocAllSources map { _.flatten }, | ||
unidocAllClasspaths <<= (thisProjectRef, buildStructure, unidocExclude) flatMap allClasspaths, | ||
unidocClasspath <<= unidocAllClasspaths map { _.flatten.map(_.data).distinct }, | ||
unidoc <<= unidocTask | ||
) | ||
|
||
def allSources(projectRef: ProjectRef, structure: Load.BuildStructure, exclude: Seq[String]): Task[Seq[Seq[File]]] = { | ||
val projects = aggregated(projectRef, structure, exclude) | ||
projects flatMap { sources in Compile in LocalProject(_) get structure.data } join | ||
} | ||
|
||
def allClasspaths(projectRef: ProjectRef, structure: Load.BuildStructure, exclude: Seq[String]): Task[Seq[Classpath]] = { | ||
val projects = aggregated(projectRef, structure, exclude) | ||
projects flatMap { dependencyClasspath in Compile in LocalProject(_) get structure.data } join | ||
} | ||
|
||
def aggregated(projectRef: ProjectRef, structure: Load.BuildStructure, exclude: Seq[String]): Seq[String] = { | ||
val aggregate = Project.getProject(projectRef, structure).toSeq.flatMap(_.aggregate) | ||
aggregate flatMap { ref => | ||
if (exclude contains ref.project) Seq.empty | ||
else ref.project +: aggregated(ref, structure, exclude) | ||
} | ||
} | ||
|
||
def unidocTask: Initialize[Task[File]] = { | ||
(compilers, cacheDirectory, unidocSources, unidocClasspath, unidocDirectory, scalacOptions in (Compile, doc), streams) map { | ||
(compilers, cache, sources, classpath, target, options, s) => { | ||
val scaladoc = new Scaladoc(100, compilers.scalac) | ||
scaladoc.cached(cache / "unidoc", "main", sources, classpath, target, options.filter(x => !(x.startsWith("-X") || x.startsWith("-P"))), s.log) | ||
target | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "0.6.0") ++ | ||
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.0") | ||
|
||
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "0.6.0") |
Oops, something went wrong.