Skip to content

Commit f2f2da6

Browse files
committed
Relax usage of -Yscala2-unpickler for the sbt-bridge tests
1 parent 989f088 commit f2f2da6

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

project/Build.scala

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,21 @@ object Build {
782782

783783
lazy val `dotty-sbt-bridge` = project.in(file("sbt-bridge")).asDottySbtBridge(NonBootstrapped)
784784
lazy val `dotty-sbt-bridge-bootstrapped` = project.in(file("sbt-bridge")).asDottySbtBridge(Bootstrapped)
785+
.settings(
786+
// Tweak -Yscala2-unpickler to allow some sbt dependencies used in tests
787+
scalacOptions in Test := {
788+
val oldOptions = (scalacOptions in Test).value
789+
val i = oldOptions.indexOf("-Yscala2-unpickler")
790+
assert(i != -1)
791+
val oldValue = oldOptions(i + 1)
792+
793+
val attList = (dependencyClasspath in Test).value
794+
val sbtIo = findLib(attList, "org.scala-sbt/io")
795+
val zincApiInfo = findLib(attList, "zinc-apiinfo")
796+
797+
oldOptions.updated(i + 1, s"$sbtIo:$zincApiInfo:$oldValue")
798+
}
799+
)
785800

786801
lazy val `dotty-language-server` = project.in(file("language-server")).
787802
dependsOn(dottyCompiler(Bootstrapped)).

0 commit comments

Comments
 (0)