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" 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 */