aboutsummaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2017-02-22 18:44:45 +0100
committerFelix Mulder <felix.mulder@gmail.com>2017-02-22 21:30:20 +0100
commit9914d1a5a9de39a8f4fc1eff03651a23611d6651 (patch)
tree34af7ce103d6cefb4582a6f1af21ae14abc8228c /project
parent18c673073c29641cdd8386253ee34d7e4007b3b1 (diff)
downloaddotty-9914d1a5a9de39a8f4fc1eff03651a23611d6651.tar.gz
dotty-9914d1a5a9de39a8f4fc1eff03651a23611d6651.tar.bz2
dotty-9914d1a5a9de39a8f4fc1eff03651a23611d6651.zip
Add dottydoc shorthand
Diffstat (limited to 'project')
-rw-r--r--project/Build.scala12
1 files changed, 12 insertions, 0 deletions
diff --git a/project/Build.scala b/project/Build.scala
index f03111f76..08b1b4f4e 100644
--- a/project/Build.scala
+++ b/project/Build.scala
@@ -56,6 +56,9 @@ object DottyBuild extends Build {
// Compiles the documentation and static site
lazy val genDocs = inputKey[Unit]("run dottydoc to generate static documentation site")
+ // Shorthand for compiling a docs site
+ lazy val dottydoc = inputKey[Unit]("run dottydoc")
+
/** Dottydoc deps */
lazy val dottydocDeps = SettingKey[Seq[ModuleID]](
"dottydocDeps",
@@ -273,6 +276,15 @@ object DottyBuild extends Build {
)
}.evaluated,
+ dottydoc := Def.inputTaskDyn {
+ val args: Seq[String] = spaceDelimited("<arg>").parsed
+ val dottyLib = packageAll.value("dotty-library")
+ val dottyInterfaces = packageAll.value("dotty-interfaces")
+ val otherDeps = (dependencyClasspath in Compile).value.map(_.data).mkString(":")
+ val cp: Seq[String] = Seq("-classpath", s"$dottyLib:$dottyInterfaces:$otherDeps")
+ (runMain in Compile).toTask(s""" dotty.tools.dottydoc.Main ${cp.mkString(" ")} """ + args.mkString(" "))
+ }.evaluated,
+
// Override run to be able to run compiled classfiles
dotr := {
val args: Seq[String] = spaceDelimited("<arg>").parsed