Reputation: 11512
I'm building a library I want to support Scala 2.12 and 2.13 targets. There are a few differences between these versions that are just incompatible, meaning I need different code for a few areas between the 2 versions.
For example 2.12.x Builder (abstract class) requires you to implement a method '+='. In 2.13.x '+=' is now final and you need to implement method 'addOne'. Argh. A few things like that.
What's the best way (using sbt) to organize my build to accommodate the differences, since Scala doesn't have conditional compilation?
Upvotes: 4
Views: 790
Reputation: 11512
Both Luis Miguel and Sascha's answers are correct. Cats does have a good example and SBT has this ability. Couldn't find it in the docs, but it's explained here: https://github.com/twitter/util/issues/219
Upvotes: 2