5

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.

Jacek Laskowski
  • 72,696
  • 27
  • 242
  • 420
larsrh
  • 2,579
  • 8
  • 30
  • Alexey Romanov has pointed out that https://stackoverflow.com/posts/28404706/revisions is a duplicate. – larsrh Sep 11 '15 at 21:19

1 Answers1

2

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
Eugene Yokota
  • 94,654
  • 45
  • 215
  • 319