You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describes the new `scala_toolchains()` API, breaking changes, Bazel
compatibility matrix, and breaking of the `io_bazel_rules_scala` repo
name dependency. Part of bazel-contrib#1482, bazel-contrib#1647, bazel-contrib#1652, and bazel-contrib#1699, it also removes
obsolete `WORKSPACE` APIs in favor of `scala_toolchains()`, et. al.
Much of the README text regarding `WORKSPACE` configuration, Bazel
compatibility, and breaking changes comes from:
- bazel-contrib#1482 (comment)
The "Breaking changes in `rules_scala` 7.x" section of `README.md`
describes the removed `WORKSPACE` macros, and provides guidance for
adopting the `scala_toolchains()` API. Also includes information about
the upcoming Bzlmod implementation (bazel-contrib#1482) and the Bazel 8 compatibility
changes for `rules_scala` 8.x (bazel-contrib#1652).
Contains a light editing pass over almost every Markdown file to resolve
`markdownlint` warnings when editing in VSCode. Also added
`.markdownlint.json` to silence rule `MD033/no-inline-html`, since
several docs contain `<br/>` and/or `<table>` elements.
- https://github.com/DavidAnson/vscode-markdownlint?tab=readme-ov-file#markdownlintconfig
Performed other opportunistic grammar edits and added new information,
including:
- `docs/coverage.md`: Describes how to determine the default JaCoCo
version used by `rules_java`
- `scripts/README.md`: Updates `create_repository.py` docs extensively,
and adds a section for `sync_bazelversion.sh`
---
Since the next major release is imminent, ensuring the documentation
accurately reflects all the changes since v6.6.0 has become an urgent
priority.
Rather than leave the old `WORKSPACE` APIs in place, which could lead to
surprising failures, this change removes all of them. This also changes
some code that still depended on some of these obsolete macros,
including `scala_toolchains()`. Since all the toolchainization changes
led to the entire project already using `scala_toolchains()` and
`scala_register_toolchains()` exclusively, this proved a low risk
refactoring.
With some Bzlmod and Bazel 8 information already in place, very little
will need to change when these implementations land. The commits that
contain those implementations will also include their relevant
documentation updates.
This should produce a single `bazel-out/_coverage/_coverage_report.dat` from all coverage files that are generated.
23
23
24
-
###Processing coverage reports
24
+
## Processing coverage reports
25
25
26
-
You can install `lcov` package (that supports the format Bazel uses for coverage reports) to have access to additional tools:
26
+
You can install the [`lcov`](https://github.com/linux-test-project/lcov) package (that supports the format Bazel uses for coverage reports) to have access to additional tools:
27
27
28
-
```
28
+
```txt
29
29
# Use your system package manager. E.g. on Ubuntu:
30
30
sudo apt install lcov
31
31
```
32
32
33
33
Having `lcov` package installed you can extract information from your coverage reports:
34
34
35
-
```
35
+
```txt
36
36
# For a summary:
37
37
lcov --summary your-coverage-report.dat
38
38
# For details:
@@ -55,26 +55,78 @@ echo "coverage report at file://${destdir}/index.html"
55
55
56
56
```
57
57
58
-
###Support for testing frameworks
58
+
## Support for testing frameworks
59
59
60
60
Coverage support has been only tested with [ScalaTest](http://www.scalatest.org/).
61
61
62
-
### Working around missing lambda coverage with Scala 2.12+
62
+
##JaCoCo
63
63
64
-
The current Jacoco version in Bazel (0.8.3) has missing coverage for lambdas
65
-
(including for comprehensions; see issue https://github.com/bazelbuild/rules_scala/issues/1056). Also, the support for
66
-
filtering out code generated by the Scala compiler is quite reduced in Jacoco.
64
+
`rules_scala` uses the [JaCoCo](https://www.jacoco.org/jacoco/) library imported
65
+
by the underlying [`rules_java`](https://github.com/bazelbuild/rules_java)
66
+
module to generate code coverage. `rules_java`, in turn, imports JaCoCo via the
67
+
[`java_tools`](https://github.com/bazelbuild/java_tools) repository, built from
Standard [toolchain resolution](https://bazel.build/extending/toolchains#toolchain-resolution) procedure determines which toolchain to use for Scala targets.
189
218
190
219
Toolchain should declare its compatibility with Scala version by using `target_settings` attribute of the `toolchain` rule:
`rules_scala` consists of many toolchains implementing various toolchain types.
202
232
Their support level for cross-build setup varies.
203
233
204
234
We can distinguish following tiers:
205
235
206
-
* No `target_settings` set – not migrated, will work on the default `SCALA_VERSION`; undefined behavior on other versions.
207
-
* (all toolchains not mentioned elsewhere)
208
-
*`target_settings` set to the `SCALA_VERSION` – not fully migrated; will work only on the default `SCALA_VERSION` and will fail the toolchain resolution on other versions.
209
-
* (no development in progress)
210
-
* Multiple toolchain instances with `target_settings` corresponding to each of `SCALA_VERSIONS` – fully migrated; will work in cross-build setup.
211
-
*[the main Scala toolchain](/scala/BUILD)
212
-
*[Scalafmt](/scala/scalafmt/BUILD)
213
-
*[Scalatest](/testing/testing.bzl)
236
+
- No `target_settings` set – not migrated, will work on the default `SCALA_VERSION`; undefined behavior on other versions.
237
+
- (all toolchains not mentioned elsewhere)
238
+
-`target_settings` set to the `SCALA_VERSION` – not fully migrated; will work only on the default `SCALA_VERSION` and will fail the toolchain resolution on other versions.
239
+
- (no development in progress)
240
+
- Multiple toolchain instances with `target_settings` corresponding to each of `SCALA_VERSIONS` – fully migrated; will work in cross-build setup.
0 commit comments