Skip to content

Commit b131900

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

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,25 @@ 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+
## Selecting Scala version
65+
66+
Rules scala supports all minor versions of Scala 2.11/2.12. By default `Scala 2.11.12` is used and to use another
67+
version you need to
68+
specify it when calling `scala_repositories`. `scala_repositories` takes a tuple `(scala_version, scala_version_jar_shas)`
69+
as a parameter where `scala_version` is the scala version and `scala_version_jar_shas` is a `dict` with
70+
`sha256` hashes for the maven artifacts `scala_library`, `scala_reflect` and `scala_compiler`:
71+
```python
72+
scala_repositories(("2.12.6", {
73+
"scala_compiler": "3e892546b72ab547cb77de4d840bcfd05c853e73390fed7370a8f19acb0735a0",
74+
"scala_library": "0b3d6fd42958ee98715ba2ec5fe221f4ca1e694d7c981b0ae0cd68e97baf6dce",
75+
"scala_reflect": "6ba385b450a6311a15c918cf8688b9af9327c6104f0ecbd35933cfcd3095fe04"
76+
}))
77+
```
78+
If you're using any of the rules `twitter_scrooge`, `tut_repositories`, `scala_proto_repositories`
79+
or `specs2_junit_repositories` you also need to specify `scala_version` for them. See `./test_version/WORKSPACE.template`
80+
for an example workspace using another scala version.
81+
82+
6483
## Bazel compatible versions
6584

6685
| bazel | rules_scala gitsha |

0 commit comments

Comments
 (0)