Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i change the Scala version that sbt works with?

Tags:

scala

sbt

Firing up the SBT console it 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 make it use MyProject with sbt 0.7.4 and Scala 2.8.1 ? Please pay attenetion that I'm not asking about the Scala version that is used to build my project (it is the 2.8.1 as you can see), but I rather want to make sbt use MyProject with Scala 2.8.1. Apparently sbt uses it's own scala version to work with project definition (MyProject here) which is different than one it uses to actually build the project! or perhaps I'm missing something ... ?

like image 340
Ashkan Kh. Nazary Avatar asked Dec 13 '22 16:12

Ashkan Kh. Nazary


1 Answers

I can see your concern about SBT still using 2.7.7 internally, but it doesn't really matter since SBT downloads that version on its own. You do not have to install 2.7.7 or anything, just forget about it and pretend your environment is pure Scala 2.8.

The configuration file that holds the SBT version setting is: project/build.properties. The content looks like this:

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

When you want to move up to the next SBT version, just change 0.7.4 to that version and SBT will update itself. Eventually SBT will use some other Scala version internally, but this will not matter to the user.

like image 168
olle kullberg Avatar answered Jan 05 '23 15:01

olle kullberg