Skip to content

Commit 511e06c

Browse files
committed
Fix scripted tests when the dotty artifact is not in cache
1 parent e01e970 commit 511e06c

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

project/Build.scala

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,19 @@ object DottyBuild extends Build {
8484

8585

8686
/** Projects -------------------------------------------------------------- */
87+
88+
// Needed because the dotty project aggregates dotty-sbt-bridge but dotty-sbt-bridge
89+
// currently refers to dotty in its scripted task and "aggregate" does not take by-name
90+
// parameters: https://github.com/sbt/sbt/issues/2200
91+
lazy val dottySbtBridgeRef = LocalProject("dotty-sbt-bridge")
92+
8793
// The root project:
8894
// - aggregates other projects so that "compile", "test", etc are run on all projects at once.
8995
// - publishes its own empty artifact "dotty" that depends on "dotty-library" and "dotty-compiler",
9096
// this is only necessary for compatibility with sbt which currently hardcodes the "dotty" artifact name
9197
lazy val dotty = project.in(file(".")).
9298
// FIXME: we do not aggregate `bin` because its tests delete jars, thus breaking other tests
93-
aggregate(`dotty-interfaces`, `dotty-library`, `dotty-compiler`, `dotty-sbt-bridge`, `scala-library`).
99+
aggregate(`dotty-interfaces`, `dotty-library`, `dotty-compiler`, dottySbtBridgeRef, `scala-library`).
94100
dependsOn(`dotty-compiler`).
95101
dependsOn(`dotty-library`).
96102
settings(
@@ -428,9 +434,10 @@ object DottyBuild extends Build {
428434
ScriptedPlugin.scriptedLaunchOpts := Seq("-Xmx1024m"),
429435
ScriptedPlugin.scriptedBufferLog := false,
430436
ScriptedPlugin.scripted := {
431-
val x1 = (publishLocal in `dotty-compiler`).value
432-
val x2 = (publishLocal in `dotty-library`).value
433-
val x3 = (publishLocal in `dotty-interfaces`).value
437+
val x1 = (publishLocal in `dotty-interfaces`).value
438+
val x2 = (publishLocal in `dotty-compiler`).value
439+
val x3 = (publishLocal in `dotty-library`).value
440+
val x4 = (publishLocal in dotty).value // Needed because sbt currently hardcodes the dotty artifact
434441
ScriptedPlugin.scriptedTask.evaluated
435442
}
436443
// TODO: Use this instead of manually copying DottyInjectedPlugin.scala

0 commit comments

Comments
 (0)