Skip to content

Commit 9914d1a

Browse files
committed
Add dottydoc shorthand
1 parent 18c6730 commit 9914d1a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

project/Build.scala

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ object DottyBuild extends Build {
5656
// Compiles the documentation and static site
5757
lazy val genDocs = inputKey[Unit]("run dottydoc to generate static documentation site")
5858

59+
// Shorthand for compiling a docs site
60+
lazy val dottydoc = inputKey[Unit]("run dottydoc")
61+
5962
/** Dottydoc deps */
6063
lazy val dottydocDeps = SettingKey[Seq[ModuleID]](
6164
"dottydocDeps",
@@ -273,6 +276,15 @@ object DottyBuild extends Build {
273276
)
274277
}.evaluated,
275278

279+
dottydoc := Def.inputTaskDyn {
280+
val args: Seq[String] = spaceDelimited("<arg>").parsed
281+
val dottyLib = packageAll.value("dotty-library")
282+
val dottyInterfaces = packageAll.value("dotty-interfaces")
283+
val otherDeps = (dependencyClasspath in Compile).value.map(_.data).mkString(":")
284+
val cp: Seq[String] = Seq("-classpath", s"$dottyLib:$dottyInterfaces:$otherDeps")
285+
(runMain in Compile).toTask(s""" dotty.tools.dottydoc.Main ${cp.mkString(" ")} """ + args.mkString(" "))
286+
}.evaluated,
287+
276288
// Override run to be able to run compiled classfiles
277289
dotr := {
278290
val args: Seq[String] = spaceDelimited("<arg>").parsed

0 commit comments

Comments
 (0)