How do I tell sbt to use a nightly build of Scala

2019-08-11 16:54发布

问题:

Scala Migrations, which builds with sbt, found SI-6646 in Scala 2.10.0-RC2. I want to test the committed fix before RC3 is released to confirm it all works. How do I tell sbt to use a nightly Scala 2.10.0 build?

回答1:

You first need to add a new resolver to your project settings in your .build. We import the Sonatype repository which have the last commits from Scala. Look at this link to see the list of all the versions available.

resolvers += Resolver.sonatypeRepo("snapshots")

Then just change the Scala version, again in the sbt settings.

scalaVersion := "2.10.0-SNAPSHOT"


回答2:

I haven't tried this, but you could pull the code from github (https://github.com/scala/scala) by following this question: How can sbt pull dependency artifacts from git?

Then, call ant from sbt to build the compiler: https://bitbucket.org/jmhofer/ant4sbt/wiki/Home

The only part I am not certain about is that you need to copy the scala compiler and libraries in the correct folder that sbt uses, but you can look at where that goes on your machine.

Then, just do a clean and build.



标签: scala sbt