How to change Scala version for build definition?

前端 未结 3 890
你的背包
你的背包 2021-01-20 07:00

I\'m developing a simple SBT project that includes InputTasks for benchmarking Scala Parallel collections.

I have defined the InputKeys and started writing the tasks

相关标签:
3条回答
  • 2021-01-20 07:43

    You can't modify the version of Scala that is used to to compile the project definition, because it must be a version binary compatible with the version used to compile SBT itself. There's some flexibility being studied in this regard, but, right now, it's fixed.

    The setting scalaVersion will change the version of Scala used to compile the project itself. The project can be compiled with completely different versions and, in fact, you can even have SBT compile your project with multiple Scala versions.

    0 讨论(0)
  • 2021-01-20 07:54

    scalaVersion only impacts the version of Scala used to compile the "actual" source code (usually located in src/...). Your error comes from a part of the build definition (under project/), which is always compiled with the Scala version that sbt was built with.

    0 讨论(0)
  • 2021-01-20 07:55

    you can change the scala version in file "project/build.properties" e.g. sbt.version=0.11.2

    0 讨论(0)
提交回复
热议问题