28

I want to write a plugin using scala 2.11

sbtPlugin := true

scalaVersion := "2.11.0"

The current sbt release (0.13.9) is built on scala 2.10.5 https://github.com/sbt/sbt/blob/0.13.9/build.sbt#L27

EDIT: Does build against 2.11 in the community build.

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 ==--
Seth Tisue
  • 29,985
  • 11
  • 82
  • 149
Guillaume Massé
  • 8,004
  • 8
  • 44
  • 57

2 Answers2

17

We can't break binary compatibility for all the sbt 0.13 plugins until we release the next version sbt 0.14 or potentially sbt 1.0, so no Scala 2.11.x sbt until then.

Update:

One way to work around this is to use Fork API. sbt 0.13 is capable of building Scala 2.11 source using Scala 2.11 compilers. You can mimic the way its done, and run Scala 2.10 or 2.11 code from sbt.

Eugene Yokota
  • 94,654
  • 45
  • 215
  • 319
  • Is there a snapshot of sbt 0.14.x that supports 2.11.x ? I saw https://github.com/sbt/sbt/tree/sbt-0.13.1-scala-2.11.0-M8 – Guillaume Massé Apr 25 '14 at 03:35
  • Grzegorz is a compiler guy so maybe he was testing compatibility or incremental compiler. We already have 0.13.2 and 0.13.5 milestones. Once 0.13.5 comes out, there might be some milestone in the future. – Eugene Yokota Apr 25 '14 at 03:44
  • 1
    We build sbt against Scala master (2.11 nightly builds) every night here: https://jenkins-dbuild.typesafe.com:8499/job/Community-2.11.x/120/console However, those builds are not published. We run them just to detect whether compiler has regressed. This shows you, that sbt can be built with Scala 2.11. – Grzegorz Kossakowski Apr 25 '14 at 10:21
  • @GrzegorzKossakowski cool. I always loved the idea of the community uber build. This is what Scala is all about. – Guillaume Massé Apr 26 '14 at 15:57
  • 9
    Guys do you have a rough estimate when an sbt release or snapshot compiled with 2.11.x would come out? I just made quite a big plugin using scala 2.11.2 and java 8 and when I started to add commands and stuff into Settings I found out this sad fact :-) – lisak Aug 10 '14 at 14:52
  • @EugeneYokota I'm also interested in a (snapshot or otherwise) 2.11 build of the compiler-interface jar as we have an in-house build tool that depends on zinc. Zinc actually depends on a fully assembled sbt jar and it is not obvious how to create one manually. – fommil Feb 10 '15 at 10:16
  • 3
    not being able to create 2.11 based plugins is a real PITA ;-), any ETA on when 2.11 support will land in SBT? – virtualeyes May 28 '15 at 07:48
  • 3
    Not to beat the horse, but any update on the next version of SBT? The lack of 2.11 support is a headache. – Nathaniel Ford Aug 19 '16 at 19:06
  • 1
    3 years passed and there is no support for 2.11. – heroxbd May 06 '17 at 12:17
  • 3
    There will never be a 2.11 support because sbt 1.0.0 will be on Scala 2.12 - http://developer.lightbend.com/blog/2017-04-18-sbt-1-0-roadmap-and-beta1/ – Eugene Yokota May 24 '17 at 04:16
  • @GrzegorzKossakowski, your typesafe.com link is no more. Do you still have an example of this? EugeneYokota, thanks for the explanation. You don't happen to have an example of using the Fork API for this purpose? The docs page link for Fork API has no description. – Mikeumus Dec 02 '17 at 10:01
1

sbt now uses Scala 2.12

The current version of sbt is 1.2.8 (released 30th December 2018) and it supports Scala 2.12 since 1.0.0 (released 10th August 2017)

sbt 1.0 uses Scala 2.12 for build definitions and plugins. This also requires JDK 8.

https://www.scala-sbt.org/1.x/docs/sbt-1.0-Release-Notes.html#sbt+1.0.0

We simply skipped Scala 2.11 and went directly to 2.12.

Guillaume Massé
  • 8,004
  • 8
  • 44
  • 57