File tree Expand file tree Collapse file tree 2 files changed +37
-3
lines changed Expand file tree Collapse file tree 2 files changed +37
-3
lines changed Original file line number Diff line number Diff line change @@ -283,7 +283,8 @@ object Build {
283283 )
284284
285285 // Settings used when compiling dotty with a non-bootstrapped dotty
286- lazy val commonBootstrappedSettings = commonDottySettings ++ Seq (
286+ lazy val commonBootstrappedSettings = commonDottySettings ++ NoBloopExport .settings ++ Seq (
287+ bspEnabled := false ,
287288 unmanagedSourceDirectories in Compile += baseDirectory.value / " src-bootstrapped" ,
288289
289290 version := dottyVersion,
@@ -419,9 +420,11 @@ object Build {
419420 ),
420421
421422 // For convenience, change the baseDirectory when running the compiler
422- baseDirectory in (Compile , run) := baseDirectory.value / " .." ,
423+ (Compile / forkOptions) := (Compile / forkOptions).value.withWorkingDirectory((ThisBuild / baseDirectory).value),
424+ (Compile / run / forkOptions) := (Compile / run / forkOptions).value.withWorkingDirectory((ThisBuild / baseDirectory).value),
423425 // And when running the tests
424- baseDirectory in Test := baseDirectory.value / " .." ,
426+ (Test / forkOptions) := (Test / forkOptions).value.withWorkingDirectory((ThisBuild / baseDirectory).value),
427+ (Test / testOnly / forkOptions) := (Test / testOnly / forkOptions).value.withWorkingDirectory((ThisBuild / baseDirectory).value),
425428
426429 test in Test := {
427430 // Exclude VulpixMetaTests
Original file line number Diff line number Diff line change 1+ import sbt ._
2+ import Keys ._
3+
4+ /* With <3 from scala-js */
5+ object NoBloopExport {
6+ private lazy val bloopGenerateKey : Option [TaskKey [Option [File ]]] = {
7+ val optBloopKeysClass : Option [Class [_]] = try {
8+ Some (Class .forName(" bloop.integrations.sbt.BloopKeys" ))
9+ } catch {
10+ case _ : ClassNotFoundException => None
11+ }
12+
13+ optBloopKeysClass.map { bloopKeysClass =>
14+ val bloopGenerateGetter = bloopKeysClass.getMethod(" bloopGenerate" )
15+ bloopGenerateGetter.invoke(null ).asInstanceOf [TaskKey [Option [File ]]]
16+ }
17+ }
18+
19+ /** Settings to prevent the project from being exported to IDEs. */
20+ lazy val settings : Seq [Setting [_]] = {
21+ bloopGenerateKey match {
22+ case None =>
23+ Nil
24+ case Some (key) =>
25+ Seq (
26+ key in Compile := None ,
27+ key in Test := None ,
28+ )
29+ }
30+ }
31+ }
You can’t perform that action at this time.
0 commit comments