Skip to content

Fix launchIDE in the Dotty build after the full bootstrap #6353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -977,12 +979,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
Expand Down
24 changes: 14 additions & 10 deletions sbt-dotty/src/dotty/tools/sbtplugin/DottyIDEPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down