Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to ignore submodules per Scala version, say 2.10? [duplicate]

Tags:

scala

sbt

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.

like image 301
larsrh Avatar asked Oct 31 '22 19:10

larsrh


1 Answers

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
like image 153
Eugene Yokota Avatar answered Nov 15 '22 07:11

Eugene Yokota