From 9b80d97974c233089b999ca3b7d212388cac66ca Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Mon, 22 Apr 2019 18:03:50 +0200 Subject: [PATCH 1/2] Compile the community-build with the bootstrapped compiler Previously we compiled it with the reference compiler. Both work, but using the bootstrapped compiler means we can catch potential regressions before we update the reference compiler to a new version. --- project/Build.scala | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/project/Build.scala b/project/Build.scala index 0287cfcbd240..823c5f6e436e 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -977,12 +977,9 @@ object Build { val updateCommunityBuild = taskKey[Unit]("Updates the community build.") lazy val `community-build` = project.in(file("community-build")). - settings(commonSettings). + dependsOn(dottyLibrary(Bootstrapped)). + settings(commonBootstrappedSettings). settings( - scalaVersion := referenceVersion, - // To be removed once we stop cross-compiling with Scala 2 - crossScalaVersions := Seq(referenceVersion, scalacVersion), - prepareCommunityBuild := { (publishLocal in `dotty-sbt-bridge`).value (publishLocal in `dotty-interfaces`).value From 8439dcb4d5805914beb99c023eed1bb7a43f1ee6 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Mon, 22 Apr 2019 18:07:35 +0200 Subject: [PATCH 2/2] Fix launchIDE in the Dotty build after the full bootstrap - Make sure that when the `excludeFromIDE` sbt-dotty plugin setting is on in a project, we don't try to run any non-trivial task in that project. - Add all non-bootstrapped projects to `excludeFromIDE`, we always want to run the IDE with a bootstrapped compiler in the Dotty build. We did not need to do this before the full bootstrap because the non-bootstrapped projects were automatically excluded since they were Scala 2 projects. --- project/Build.scala | 6 +++-- .../tools/sbtplugin/DottyIDEPlugin.scala | 24 +++++++++++-------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/project/Build.scala b/project/Build.scala index 823c5f6e436e..d54d83170957 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -189,7 +189,8 @@ object Build { // Do not append Scala versions to the generated artifacts crossPaths := false, // Do not depend on the Scala library - autoScalaLibrary := false + autoScalaLibrary := false, + excludeFromIDE := true ) // Settings used when compiling dotty (both non-boostrapped and bootstrapped) @@ -203,7 +204,8 @@ object Build { version := dottyNonBootstrappedVersion, scalaVersion := referenceVersion, // To be removed once we stop cross-compiling with Scala 2 - crossScalaVersions := Seq(referenceVersion, scalacVersion) + crossScalaVersions := Seq(referenceVersion, scalacVersion), + excludeFromIDE := true ) // Settings used when compiling dotty with a non-bootstrapped dotty diff --git a/sbt-dotty/src/dotty/tools/sbtplugin/DottyIDEPlugin.scala b/sbt-dotty/src/dotty/tools/sbtplugin/DottyIDEPlugin.scala index 4f2610362a7e..8ddd106ed5bb 100644 --- a/sbt-dotty/src/dotty/tools/sbtplugin/DottyIDEPlugin.scala +++ b/sbt-dotty/src/dotty/tools/sbtplugin/DottyIDEPlugin.scala @@ -82,16 +82,20 @@ object DottyIDEPlugin extends AutoPlugin { val (dottyVersions, dottyProjRefs) = structure.allProjectRefs.flatMap { projRef => - val version = scalaVersion.in(projRef).get(settings).get - if (isDottyVersion(version)) - Some((version, projRef)) - else - crossScalaVersions.in(projRef).get(settings).get.filter(isDottyVersion).sorted.lastOption match { - case Some(v) => - Some((v, projRef)) - case _ => - None - } + if (excludeFromIDE.in(projRef).get(settings) == Some(true)) + None + else { + val version = scalaVersion.in(projRef).get(settings).get + if (isDottyVersion(version)) + Some((version, projRef)) + else + crossScalaVersions.in(projRef).get(settings).get.filter(isDottyVersion).sorted.lastOption match { + case Some(v) => + Some((v, projRef)) + case _ => + None + } + } }.unzip if (dottyVersions.isEmpty)