aboutsummaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2017-01-17 16:20:17 +0100
committerFelix Mulder <felix.mulder@gmail.com>2017-01-31 14:32:39 +0100
commit637c888b8fad660464fc1b35d40279c3482cab65 (patch)
tree3502666c4a0eb5a07d24aee9870c4468384256fc /project
parente77fe63f98099caca481f74f3613c5814fff3020 (diff)
downloaddotty-637c888b8fad660464fc1b35d40279c3482cab65.tar.gz
dotty-637c888b8fad660464fc1b35d40279c3482cab65.tar.bz2
dotty-637c888b8fad660464fc1b35d40279c3482cab65.zip
Add `genDocs` command to sbt in order to generate docs
Diffstat (limited to 'project')
-rw-r--r--project/Build.scala18
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