2011-05-09 21:26:17 +12:00
|
|
|
/**
|
|
|
|
|
* Copyright (C) 2009-2011 Scalable Solutions AB <http://scalablesolutions.se>
|
|
|
|
|
*/
|
|
|
|
|
|
2011-05-05 14:51:36 +12:00
|
|
|
import sbt._
|
|
|
|
|
|
|
|
|
|
trait DocParentProject extends ParentProject {
|
|
|
|
|
def docOutputPath = outputPath / "doc" / "main" / "api"
|
|
|
|
|
|
|
|
|
|
def docProjectDependencies = topologicalSort.dropRight(1)
|
|
|
|
|
|
|
|
|
|
def docMainSources =
|
|
|
|
|
docProjectDependencies.map {
|
|
|
|
|
case sp: ScalaPaths => sp.mainSources
|
|
|
|
|
case _ => Path.emptyPathFinder
|
|
|
|
|
}.foldLeft(Path.emptyPathFinder)(_ +++ _)
|
|
|
|
|
|
|
|
|
|
def docCompileClasspath =
|
|
|
|
|
docProjectDependencies.map {
|
|
|
|
|
case bsp: BasicScalaProject => bsp.compileClasspath
|
|
|
|
|
case _ => Path.emptyPathFinder
|
|
|
|
|
}.foldLeft(Path.emptyPathFinder)(_ +++ _)
|
|
|
|
|
|
|
|
|
|
def docLabel = "main"
|
|
|
|
|
|
|
|
|
|
def docMaxErrors = 100
|
|
|
|
|
|
|
|
|
|
def docOptions: Seq[String] = Seq.empty
|
|
|
|
|
|
|
|
|
|
lazy val doc = docAction describedAs ("Create combined scaladoc for all subprojects")
|
|
|
|
|
|
|
|
|
|
def docAction = task {
|
|
|
|
|
val scaladoc = new Scaladoc(docMaxErrors, buildCompiler)
|
|
|
|
|
scaladoc(docLabel, docMainSources.get, docCompileClasspath.get, docOutputPath, docOptions, log)
|
|
|
|
|
}
|
|
|
|
|
}
|