sbt-projectmatrix 0.4.0 came pretty close, but there are some issue I ran into when I tried to use it in a real project. First is the lack of %
syntax.
It's fairly common for subprojects to depend only from Test
configuration, or depend on Compile
from Compile
, and Test
from Test
. 0.5.0 adds %
to make this possible.
lazy val app = (projectMatrix in file("app"))
.dependsOn(core % "compile->compile;test->test")
.settings(
name := "app"
)
.jvmPlatform(scalaVersions = Seq("2.12.10"))
lazy val core = (projectMatrix in file("core"))
.settings(
name := "core"
)
.jvmPlatform(scalaVersions = Seq("2.12.10", "2.13.1"))
Another feature that's available to Project
is .configure(...)
method. It takes a vararg of Project => Project
functions, and applies them in order. Since some of the builds I deal with uses .configure(...)
this helps me migrate from Project
to ProjectMatrix
.