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.