How to change the version of Scala sbt works with?

By clicking on the SBT console, he reads:

[info] Building project AYLIEN 1.0 against Scala 2.8.1 [info] using MyProject with sbt 0.7.4 and Scala 2.7.7 

How can I use MyProject with sbt 0.7.4 and Scala 2.8.1? Please note that I am not asking about the version of Scala that is used to create my project (this is 2.8.1, as you can see), but I rather want to make sbt to use MyProject with Scala 2.8. 1. Apparently, sbt uses its own version of Scala to work with the project definition (here MyProject), which is different from the one it uses to create the project! or maybe I missed something ...?

+4
source share
2 answers

SBT 0.7. * will not work with Scala 2.8. * to determine your project . Mark Harra is currently working on the next version of SBT, which will work with 2.8. *. This means that you cannot use any Scala functions or functions that were added after Scala 2.7.7 in the project definition or plugins. The project itself can use 2.8. *.

+6
source

I see your concern that SBT is still using the inside of 2.7.7, but that doesn't really matter, since SBT downloads this version on its own. You do not need to install 2.7.7 or anything else, just forget about it and pretend your environment is clean Scala 2.8.

A configuration file containing the version of the SBT version: project/build.properties . The content is as follows:

 project.organization=com.ab.web project.name=cool_proj sbt.version=0.7.4 project.version=1.0 build.scala.versions=2.8.0 project.initialize=false 

If you want to upgrade to the next version of SBT, just change 0.7.4 to this version and SBT will be updated. Ultimately, SBT will use some other version of Scala internally, but that doesn't matter to the user.

+7
source

Source: https://habr.com/ru/post/1333873/


All Articles