sbt downloads new version of scala compiler and the scala library for every sbt project at this location:
./project/boot/scala-2.8.1/lib/scala-library.jar
./project/boot/scala-2.8.1/lib/scala-compiler.jar
How do I make it pick up the compiler and the library from the location pointed by $SCALA_HOME?
Also, I am surprised that it's not a common requirement. Do Scala developers prefer to use a separate copies of compiler and library for every project?
I found the same request which was unanswered: http://groups.google.com/group/simple-build-tool/browse_thread/thread/9e2c7bc34253ad0f?pli=1
Thanks in advance for your help.
Having said that, at the very beginning, sbt will always download its own internal dependencies, Scala including. It is then saved in ~/. sbt/boot . p.s. The versions of Scala used by sbt internally are not at all different from the ones you may have downloaded already for your Scala/sbt projects.
sbt uses that same version of Scala to compile the build definitions that you write for your project because they use sbt APIs. This version of Scala is fixed for a specific sbt release and cannot be changed. For sbt 1.7. 1, this version is Scala 2.12.
sbt will download Scala for you. If you install sbt-extras (basically just a script) you don't even need to download sbt : it will automatically download the sbt launcher you need. Very handy since you just need to specify sbt. version in your build.
Disclaimer, I don't use this myself but I was curious about whether this is possible.
Based on using a local scala instance, I defined the following project:
import sbt._
import java.io.File
class Test(info: ProjectInfo) extends DefaultProject(info) {
override def localScala =
defineScala("2.8.1-local", new File(System.getenv("SCALA_HOME"))) :: Nil
}
Then in project/build/build.properties
:
build.scala.versions=2.8.1-local
Then I can see that the console target works fine, which would suggest that it would work for compilation and running as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With