Created
September 1, 2011 20:28
-
-
Save machisuji/1187185 to your computer and use it in GitHub Desktop.
Generating documentation for all projects
This file contains hidden or 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
| sbt | |
| > project docs | |
| Set current project to docs 1.0 | |
| > docs | |
| [info] == docs == | |
| [info] Generating API documentation ... |
This file contains hidden or 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
| class MyParentProject(info: ProjectInfo) extends ParentProject(info) { | |
| lazy val core = project("core", "mpp-core", new Core(_)) | |
| // ... more sub projects | |
| lazy val docs = project("docs", "docs", new Docs(_), core /*, ... */) | |
| def concatPaths[T](s: Seq[T])(f: PartialFunction[T, PathFinder]): PathFinder = { | |
| def finder: T => PathFinder = f orElse { case _ => Path.emptyPathFinder } | |
| (Path.emptyPathFinder /: s)(_ +++ finder(_)) | |
| } | |
| def deepSources = concatPaths(topologicalSort) { case p: ScalaPaths => p.mainSources } | |
| def deepDocClasspath = (Path.emptyPathFinder /: dependencies.map { | |
| case p: DefaultProject => p.compileClasspath })(_ +++ _) | |
| class Docs(info: ProjectInfo) extends DefaultProject(info) { | |
| lazy val docs = scaladocTask("MyParentProject", deepSources, docPath, deepDocClasspath, documentOptions) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment