Skip to content

Commit 8439dcb

Browse files
committed
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.
1 parent 9b80d97 commit 8439dcb

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

project/Build.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ object Build {
189189
// Do not append Scala versions to the generated artifacts
190190
crossPaths := false,
191191
// Do not depend on the Scala library
192-
autoScalaLibrary := false
192+
autoScalaLibrary := false,
193+
excludeFromIDE := true
193194
)
194195

195196
// Settings used when compiling dotty (both non-boostrapped and bootstrapped)
@@ -203,7 +204,8 @@ object Build {
203204
version := dottyNonBootstrappedVersion,
204205
scalaVersion := referenceVersion,
205206
// To be removed once we stop cross-compiling with Scala 2
206-
crossScalaVersions := Seq(referenceVersion, scalacVersion)
207+
crossScalaVersions := Seq(referenceVersion, scalacVersion),
208+
excludeFromIDE := true
207209
)
208210

209211
// Settings used when compiling dotty with a non-bootstrapped dotty

sbt-dotty/src/dotty/tools/sbtplugin/DottyIDEPlugin.scala

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,20 @@ object DottyIDEPlugin extends AutoPlugin {
8282

8383
val (dottyVersions, dottyProjRefs) =
8484
structure.allProjectRefs.flatMap { projRef =>
85-
val version = scalaVersion.in(projRef).get(settings).get
86-
if (isDottyVersion(version))
87-
Some((version, projRef))
88-
else
89-
crossScalaVersions.in(projRef).get(settings).get.filter(isDottyVersion).sorted.lastOption match {
90-
case Some(v) =>
91-
Some((v, projRef))
92-
case _ =>
93-
None
94-
}
85+
if (excludeFromIDE.in(projRef).get(settings) == Some(true))
86+
None
87+
else {
88+
val version = scalaVersion.in(projRef).get(settings).get
89+
if (isDottyVersion(version))
90+
Some((version, projRef))
91+
else
92+
crossScalaVersions.in(projRef).get(settings).get.filter(isDottyVersion).sorted.lastOption match {
93+
case Some(v) =>
94+
Some((v, projRef))
95+
case _ =>
96+
None
97+
}
98+
}
9599
}.unzip
96100

97101
if (dottyVersions.isEmpty)

0 commit comments

Comments
 (0)