I have a multi-module SBT build cross-building against Scala 2.10, 2.11 and 2.12. I would like to add a submodule for Java 8 support. However, this is only possible for Scala 2.11 (and 2.12). My goal is to have SBT build this specific submodule only for 2.11 and 2.12 and ignore it for 2.10; in particular, not publish an artifact for 2.10.
My current working hypothesis is to override the publish
, libraryDependencies
and unmanagedSourceDirectories
keys based on the Scala version, but I was looking for a more elegant solution.
As @simon_yann on Twitter wrote, I wrote sbt-doge for this reason.
sbt-doge is a sbt plugin to aggregate across
crossScalaVersions
for multi-project builds, which I call partial cross building.
Try
> ;so clean; such test; very publishLocal
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With