我想使用scala 2.11
编写一个插件sbtPlugin := true
scalaVersion := "2.11.0"
当前的sbt版本(0.13.9)是基于scala 2.10.5构建的 https://github.com/sbt/sbt/blob/0.13.9/build.sbt#L27
修改 是否在community build中构建2.11。
https://scala-ci.typesafe.com/job/scala-2.11.x-integrate-community-build/lastSuccessfulBuild/consoleFull
[sbt] --== Extracting dependencies for sbt ==--
[sbt] Fetching https://github.com/sbt/sbt.git
[sbt] into /home/jenkins/workspace/scala-2.11.x-integrate-community-build/target-0.9.1/clones/d12473907f59fe78661e5f2a758557fe14df3ac6
[sbt] Took: 00h 00m 02.3s
[sbt] Fetching /home/jenkins/workspace/scala-2.11.x-integrate-community-build/target-0.9.1/clones/d12473907f59fe78661e5f2a758557fe14df3ac6
[sbt] into /home/jenkins/workspace/scala-2.11.x-integrate-community-build/target-0.9.1/extraction/18f58ea36720e88c2e79edce7efe5b626fc09a5e/projects/c2c0436b24853ab78d6f35ecf52a77248da4e537
[sbt] Took: 00h 00m 01.3s
[sbt] The following subprojects will be built in project sbt: launcher-interface, test-agent, control, io, datatype-generator, process, scripted-framework, interface, launcher, precompiled-2_8_2, relation, classpath, api, precompiled-2_9_2, logging, compile, run, classfile, scripted-sbt, testing, incremental-compiler, persist, compiler-integration, precompiled-2_9_3, compiler-interface, collections, completion, logic, apply-macro, tasks, task-system, cache, tracking, cross, ivy, compiler-ivy-integration, actions, command, main-settings, main, sbt, scripted-plugin
[sbt] --== End Extracting dependencies for sbt ==--
答案 0 :(得分:14)
我们无法破坏所有sbt 0.13插件的二进制兼容性,直到我们发布下一个版本sbt 0.14或者可能是sbt 1.0,所以在此之前没有Scala 2.11.x sbt。
<强>更新强>:
解决此问题的一种方法是使用Fork API。 sbt 0.13能够使用Scala 2.11编译器构建Scala 2.11源代码。您可以模仿其完成方式,并从sbt。
运行Scala 2.10或2.11代码答案 1 :(得分:1)
sbt现在使用Scala 2.12
sbt的当前版本为1.2.8(2018年12月30日发布),自1.0.0起(2017年8月10日发布)支持Scala 2.12
sbt 1.0将Scala 2.12用于构建定义和插件。这也需要JDK 8。
https://www.scala-sbt.org/1.x/docs/sbt-1.0-Release-Notes.html#sbt+1.0.0
我们只是跳过了Scala 2.11,直接进入了2.12。