-
Notifications
You must be signed in to change notification settings - Fork 28
How do I use a different scala version? #237
Comments
This page explains how to configure a custom version: https://github.com/higherkindness/rules_scala/blob/master/docs/newdocs/scala_versions.md#specifying-the-scala-version-to-use If you're fine using 2.12.8, you can simply use the default we provide by adding the following to your WORKSPACE:
It's on the roadmap to provide more default versions, but we haven't gotten around to it (#204). |
I'm going to go ahead and close this issue since there's already documentation and another open issue for simplifying things. Feel free to keep commenting if you need more help though :) |
Ehm, that was a bit quick. This is not a feature request but a question about how to solve a problem. I specifically asked Scala 2.12.10 in my question and just closing the issue with "here's how you use 2.12.8" is frankly pretty rude. I have read the examples and I know how to point to Scala 2.12.8 but just changing the 8 to a 10 didn't work and I don't know where to go from there. |
Hey @tjarvstrand my apologies, I was not trying to be rude. The link I shared explains how to use a different version of Scala. I simply suggested 2.12.8 because then you wouldn't have to do any boilerplate and a couple minor versions is oftentimes not problematic. If you'd like an example of a specific Scala version being used, here is one were we use Scala 2.11.12. The relevant files are: |
Awesome thanks! I'll have a look at that! It's just that if I'm going to sell the switch from sbt to the rest of my team it's going to be hard if we have to switch to an older Scala version |
Yeah that makes sense. Hopefully the example helps. I also updated the doc I sent you to explain how to specify the default scala configuration a little better. |
Until I found the example above, I was unable to get scala 2.11 to work. I was seeing the following error:
The key was to configure the jdk here https://github.com/lucidsoftware/play_routes_compiler_cli/blob/3bfd27c266c4958fd62ecfef6434bac3cc0bf0ba/BUILD, https://github.com/lucidsoftware/play_routes_compiler_cli/blob/3bfd27c266c4958fd62ecfef6434bac3cc0bf0ba/WORKSPACE#L42, and https://github.com/lucidsoftware/play_routes_compiler_cli/blob/3bfd27c266c4958fd62ecfef6434bac3cc0bf0ba/.bazelrc#L3 Ultimately, I'm trying to figure out what it takes to support 2.11 and 2.12 in one repo, and whether it's worth it just to push toward 2.12 instead. If you are fine with being locked on jdk 8, then this setup should work for both. Otherwise, you would want to vary the jdk based on scala version, and I don't know enough bazel yet to know if that's possible. |
We are currently at 2.12.10 at the company where I work. Unfortunately it is very unobvious for someone new how to go about using this version instead of the default one. I'm sorry to say this part seems much more straight forward in bazelbuild/rules_scala.
The text was updated successfully, but these errors were encountered: