Skip to content

Commit

Permalink
Avoid forcing scala3-library artifact
Browse files Browse the repository at this point in the history
This seems to be a bug in mill which doesn't allow to mix modules with
different Scala 3 versions. Adding a workaround in the build by
overriding a ScalaModule target
  • Loading branch information
lolgab committed Nov 15, 2023
1 parent bade8f7 commit 009fe2d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,15 @@ trait AmmInternalModule extends CrossSbtModule with Bloop.Module with TestModule
if (isScala2()) Agg(Deps.acyclic)
else Agg[Dep]()
}
override def scalaLibraryIvyDeps = T {
val scalaV = scalaVersion()
val scalaO = scalaOrganization()
if (isScala3(scalaV)) Agg(
ivy"$scalaO::scala3-library:$scalaV"
) else Agg(
ivy"$scalaO:scala-library:$scalaV"
)
}
trait Tests extends super.Tests with TestModule.Utest{
def ivyDeps = super.ivyDeps() ++ Agg(Deps.utest)
def forkArgs = Seq("-Xmx2g", "-Dfile.encoding=UTF8")
Expand Down Expand Up @@ -680,7 +689,7 @@ def unitTest(scalaBinaryVersion: String) = {
.collectFirst {
case (List(key: String), mod) if key.startsWith(scalaBinaryVersion) => mod
}
.getOrElse(sys.error(s"$module doens't have versions for $scalaBinaryVersion"))
.getOrElse(sys.error(s"$module doesn't have versions for $scalaBinaryVersion"))

T.command{
cross(terminal).test.test()()
Expand Down

0 comments on commit 009fe2d

Please sign in to comment.