简体   繁体   中英

How can I build in sbt with an unreleased version of the Scala standard library?

I would like to use the standard library of Scala 2.13.xx to use the latest unreleased version of the concurrency library. I have tried to use it:

scalaVersion := "2.13.0-M1"

which leads to: [error] sbt.librarymanagement.ResolveException: unresolved dependency: com.twitter#util-collection_2.13.0-M1;18.9.1: not found [error] unresolved dependency: org.scala-stm#scala-stm_2.13.0-M1;0.8: not found [error] unresolved dependency: org.scalactic#scalactic_2.13.0-M1;3.0.5: not found [error] unresolved dependency: org.scalatest#scalatest_2.13.0-M1;3.0.5: not found [error] unresolved dependency: com.storm-enroute#scalameter_2.13.0-M1;0.8.2: not found

Is there any way to use the latest unreleased version of the Scala standard library with sbt or is it not possible because of the dependencies which are not built with Scala 2.13.xx?

Setting scalaVersion will use both the compiler and the standard library for that version.

But any dependencies need to be built with a binary compatible Scala version. For milestones, that's only the same milestone. If you look at https://mvnrepository.com/artifact/org.scalactic/scalactic etc, all of them except ScalaMeter and util-collection do have versions published for 2.13.0-M2.

For the missing dependencies, you can get the sources, change their scalaVersion and use sbt publishLocal (or equivalent if any of them use build systems other than SBT). Hopefully they'll build and work with no source changes.

Technically you can also change only the standard library version by using

autoScalaLibrary := false
libraryDependencies += "org.scala-lang" % "scala-library" % "2.13.0-M1" % "test"

but this is unlikely to work well (if at all).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM