diff --git a/project/Build.scala b/project/Build.scala index 9fc41203f816..232b1916261d 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -448,6 +448,11 @@ object Build { ) ++ extMap } + val enableBspAllProjects = sys.env.get("ENABLE_BSP_ALL_PROJECTS").map(_.toBoolean).getOrElse{ + val enableBspAllProjectsFile = file(".enable_bsp_all_projects") + enableBspAllProjectsFile.exists() + } + // Settings used when compiling dotty with a non-bootstrapped dotty lazy val commonBootstrappedSettings = commonDottySettings ++ Seq( // To enable support of scaladoc and language-server projects you need to change this to true @@ -1344,7 +1349,7 @@ object Build { keepSJSIR := false, // Generate Scala 3 runtime properties overlay Compile / resourceGenerators += generateLibraryProperties.taskValue, - bspEnabled := false, + bspEnabled := enableBspAllProjects, ) /* Configuration of the org.scala-lang:scala3-library_3:*.**.**-bootstrapped project */ @@ -1388,7 +1393,7 @@ object Build { publish / skip := false, // Project specific target folder. sbt doesn't like having two projects using the same target folder target := target.value / "scala3-library-bootstrapped", - bspEnabled := false, + bspEnabled := enableBspAllProjects, ) /* Configuration of the org.scala-js:scalajs-scalalib_2.13:*.**.**-bootstrapped project */ @@ -1982,7 +1987,7 @@ object Build { s"-Ddotty.tools.dotc.semanticdb.test=${(ThisBuild / baseDirectory).value/"tests"/"semanticdb"}", ) }, - bspEnabled := false, + bspEnabled := enableBspAllProjects, ) // ============================================================================================== @@ -2058,7 +2063,7 @@ object Build { scalaCompilerBridgeBinaryJar := { Some((`scala3-sbt-bridge-nonbootstrapped` / Compile / packageBin).value) }, - bspEnabled := false, + bspEnabled := enableBspAllProjects, ) lazy val `scala3-presentation-compiler` = project.in(file("presentation-compiler")) @@ -2129,13 +2134,16 @@ object Build { mtagsSharedSources } (Set(mtagsSharedSourceJar)).toSeq }.taskValue, - bspEnabled := false, + bspEnabled := enableBspAllProjects, ) } lazy val `scala3-presentation-compiler-testcases` = project.in(file("presentation-compiler-testcases")) .dependsOn(`scala3-compiler-bootstrapped-new`) - .settings(commonBootstrappedSettings) + .settings( + commonBootstrappedSettings, + bspEnabled := enableBspAllProjects, + ) lazy val `scala3-language-server` = project.in(file("language-server")). dependsOn(`scala3-compiler-bootstrapped-new`, `scala3-repl`).