We have a project with several subprojects which can compile under both Scala 2.10 and 2.11, one subproject which only compiles under 2.10 (actually, Scala-Virtualized 2.10.
I had a similar question. My question had an additional complication of classpath dependencies (dependsOn
), rather than just aggregation, but one solution for my problem fixes this one quite well.
sbt-doge, a deceptively cutesy GitHub project, replaces the implementation of +
with one of its interchangeable prefixes: much, so, such, very.
Current implementation of + cross building operator does not take in account for the crossScalaVersions of the sub projects. Until that's fixed, here's an alternative implementation of it.
The creator of the project is one of the main contributors to SBT.
Add
addSbtPlugin("com.eed3si9n" % "sbt-doge" % "0.1.3")
to project/plugins.sbt
.
Then
> very compile