diff options
Diffstat (limited to 'project')
-rw-r--r-- | project/Build.scala | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/project/Build.scala b/project/Build.scala index dd492447a..f7e8e4754 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -52,6 +52,9 @@ object DottyBuild extends Build { lazy val dotr = inputKey[Unit]("run compiled binary using the correct classpath, or the user supplied classpath") + // Compiles the documentation and static site + lazy val genDocs = inputKey[Unit]("run dottydoc to generate static documentation site") + override def settings: Seq[Setting[_]] = { super.settings ++ Seq( scalaVersion in Global := scalacVersion, @@ -212,6 +215,21 @@ object DottyBuild extends Build { ) }.evaluated, + genDocs := Def.inputTaskDyn { + val dottyLib = packageAll.value("dotty-library") + val dottyInterfaces = packageAll.value("dotty-interfaces") + val otherDeps = (dependencyClasspath in Compile).value.map(_.data).mkString(":") + val sources = (managedSources in (Compile, compile)).value ++ (unmanagedSources in (Compile, compile)).value + val args: Seq[String] = Seq( + "-siteroot", "docs", + "-project", "Dotty", + "-classpath", s"$dottyLib:$dottyInterfaces:$otherDeps" + ) + (runMain in Compile).toTask( + s""" dotty.tools.dottydoc.Main ${args.mkString(" ")} ${sources.mkString(" ")}""" + ) + }.evaluated, + // Override run to be able to run compiled classfiles dotr := { val args: Seq[String] = spaceDelimited("<arg>").parsed |