From 193c57279e9a5048d8bce81068fdbff468d8e6b7 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Mon, 25 Mar 2019 17:20:01 +0100 Subject: [PATCH 1/2] sbt-dotty: Don't break scaladoc in non-Dotty projects Also fix `test:doc` for Dotty projects: we were only passing `-project` to dottydoc for `compile:doc`. Dottydoc is still probably not working correctly in user projects but I'll let whoever takes over its maintainership handle that. --- .../dotty/tools/sbtplugin/DottyPlugin.scala | 35 ++++++++++++++----- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/sbt-dotty/src/dotty/tools/sbtplugin/DottyPlugin.scala b/sbt-dotty/src/dotty/tools/sbtplugin/DottyPlugin.scala index 00457de3dbae..d1721cdfe65d 100644 --- a/sbt-dotty/src/dotty/tools/sbtplugin/DottyPlugin.scala +++ b/sbt-dotty/src/dotty/tools/sbtplugin/DottyPlugin.scala @@ -153,8 +153,6 @@ object DottyPlugin extends AutoPlugin { scalaOrganization.value }, - scalacOptions in (Compile, doc) ++= Seq("-project", name.value), - incOptions in Compile := { val inc = (incOptions in Compile).value if (isDotty.value) @@ -326,13 +324,32 @@ object DottyPlugin extends AutoPlugin { } private val docSettings = inTask(doc)(Seq( - sources := { - val _ = compile.value // Ensure that everything is compiled, so TASTy is available. - val prev = sources.value - val tastyFiles = (classDirectory.value ** "*.tasty").get.map(_.getAbsoluteFile) - prev ++ tastyFiles - }, - scalacOptions += "-from-tasty" + sources := Def.taskDyn { + val old = sources.value + + if (isDotty.value) Def.task { + val _ = compile.value // Ensure that everything is compiled, so TASTy is available. + val tastyFiles = (classDirectory.value ** "*.tasty").get.map(_.getAbsoluteFile) + old ++ tastyFiles + } else Def.task { + old + } + }.value, + scalacOptions ++= { + if (isDotty.value) { + val projectName = + if (configuration.value == Compile) + name.value + else + s"${name.value}-${configuration.value}" + Seq( + "-project", projectName, + "-from-tasty" + ) + } + else + Seq() + } )) /** Fetch artifacts for moduleID */ From 78ed9e87459917583af1a0e5cec958d61b11e690 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Mon, 25 Mar 2019 18:35:15 +0100 Subject: [PATCH 2/2] sbt-dotty: Bump to 0.3.2-SNAPSHOT --- project/Build.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/project/Build.scala b/project/Build.scala index 83718f57a9b5..f374ba9a8150 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -32,14 +32,14 @@ object Build { val scalacVersion = "2.12.8" val baseVersion = "0.14.0" - val baseSbtDottyVersion = "0.3.1" + val baseSbtDottyVersion = "0.3.2" // Versions used by the vscode extension to create a new project // This should be the latest published releases. // TODO: Have the vscode extension fetch these numbers from the Internet // instead of hardcoding them ? val publishedDottyVersion = "0.13.0-RC1" - val publishedSbtDottyVersion = "0.3.0" + val publishedSbtDottyVersion = "0.3.1" val dottyOrganization = "ch.epfl.lamp"