SBT - How to mix/create separate Scala 2.11 and Scala 2.12 folders in same project?

500 Views Asked by At

I have an sbt project with deprecated libraries (ex. Spray, pre-release macro paradise, etc) that I cannot upgrade to Scala 2.12. It compiles with Scala 2.11.8 now. I want to continue development with non-deprecated libraries (ex. Akka HTTP, latest Scala macros, etc.) by creating a folder called "2.12" and a folder called "2.11" and putting the deprecated 2.11 code in the "2.11" folder and continuing development in the "2.12" folder. The code in the "2.12" folder can cross-compile with both Scala 2.11 and Scala 2.12, but the code in the "2.11" folder can only compile with Scala 2.11. I want to be able to mix the deprecated code and the non-deprecated code in the same project, at least at first, and gradually move things over to the "2.12" folder. How do I do that with sbt?

Right now the project uses sbt 0.13 and it won't compile with sbt 1.X, but if I clean/fix up the Build.scala file and maybe convert it to a build.sbt file, I think I will be able to upgrade from 0.13 to 1.X

It is possible to change the default Scala source directory via: https://www.scala-sbt.org/1.0/docs/Howto-Customizing-Paths.html

0

There are 0 best solutions below