Skip to content

Commit 513ffc7

Browse files
committed
Add section about different scala versions to the readme
1 parent c9dffbf commit 513ffc7

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,24 @@ test --strategy=Scalac=worker
6161
```
6262
to your command line, or to enable by default for building/testing add it to your .bazelrc.
6363

64+
## Different Scala version
65+
66+
Rules scala supports all minor versions of Scala 2.11/2.12. To use an other version than the default you need to
67+
specify it when calling `scala_repositories`. `scala_repositories` takes a tuple `(scala_version, scala_version_jar_shas)`
68+
as a parameter where `scala_version` is the scala version and `scala_version_jar_shas` is a `dict` with
69+
`sha256` hashes for the maven artifacts `scala_library`, `scala_reflect` and `scala_compiler`:
70+
```python
71+
scala_repositories(("2.12.6", {
72+
"scala_compiler": "3e892546b72ab547cb77de4d840bcfd05c853e73390fed7370a8f19acb0735a0",
73+
"scala_library": "0b3d6fd42958ee98715ba2ec5fe221f4ca1e694d7c981b0ae0cd68e97baf6dce",
74+
"scala_reflect": "6ba385b450a6311a15c918cf8688b9af9327c6104f0ecbd35933cfcd3095fe04"
75+
}))
76+
```
77+
If you're using any of the rules `twitter_scrooge`, `tut_repositories`, `scala_proto_repositories`
78+
or `specs2_junit_repositories` you also need to specify `scala_version` for them. See `./test_version/WORKSPACE.template`
79+
for an example workspace using another scala version.
80+
81+
6482
## Bazel compatible versions
6583

6684
| bazel | rules_scala gitsha |

0 commit comments

Comments
 (0)