Skip to content

Commit 0a3ea9d

Browse files
authored
Use rules_scala from the Bazel Central Registry (#390)
The Bazel module for `rules_scala` v7.0.0 is now available on the Bazel Central Registry: - https://registry.bazel.build/modules/rules_scala Also: - Removes our own `rules_scala` extensions and the patch for v6.6.0, since they're no longer necessary for v7.0.0. Leaves `scala/extensions/README.md` in their place. - Demonstrates how to configure Scala version 2.13.16 for Bzlmod similarly to how the previous configuration for `rules_scala` v6.6.0.
1 parent fb37786 commit 0a3ea9d

File tree

7 files changed

+519
-527
lines changed

7 files changed

+519
-527
lines changed

MODULE.bazel

+6-6
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,13 @@ rules_ts_ext = use_extension(
153153
rules_ts_ext.deps()
154154
use_repo(rules_ts_ext, "npm_typescript")
155155

156-
bazel_dep(name = "rules_scala")
157-
archive_override(
158-
module_name = "rules_scala",
159-
sha256 = "a4700d6e6cdf13cf85e29029ec998e2ec3ba94791606ec83d2c96e3c5b0aebed",
160-
strip_prefix = "rules_scala-7.0.0",
161-
url = "https://github.com/bazelbuild/rules_scala/releases/download/v7.0.0/rules_scala-v7.0.0.tar.gz",
156+
bazel_dep(name = "rules_scala", version = "7.0.0")
157+
158+
scala_config = use_extension(
159+
"@rules_scala//scala/extensions:config.bzl",
160+
"scala_config",
162161
)
162+
scala_config.settings(scala_version = "2.13.16")
163163

164164
scala_deps = use_extension(
165165
"@rules_scala//scala/extensions:deps.bzl",

MODULE.bazel.lock

+471-363
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scala/extensions/BUILD

Whitespace-only changes.

scala/extensions/README.md

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Former `rules_scala` module extensions directory
2+
3+
We removed the [module extensions][] from this directory after the release of
4+
[rules_scala v7.0.0][], which supports [Bazel modules (a.k.a. Bzlmod)][Bzlmod]
5+
directly. We also removed the patch for `rules_scala` v6.6.0 from this
6+
directory's parent.
7+
8+
[Migrating to Bazel Modules (a.k.a. Bzlmod) - Module Extensions][post] from the
9+
[EngFlow 'bzlmod' blog post series][series] describes the former extensions and
10+
their configuration in detail. You can also see the previous files in the git
11+
history at commit `79b5193`:
12+
13+
- [MODULE.bazel](https://github.com/EngFlow/example/blob/79b51930e4629486462c0f9787a25d035b6c4450/MODULE.bazel#L167-L317)
14+
- [scala/extensions/config.bzl](https://github.com/EngFlow/example/blob/79b51930e4629486462c0f9787a25d035b6c4450/scala/extensions/config.bzl)
15+
- [scala/extensions/deps.bzl](https://github.com/EngFlow/example/blob/79b51930e4629486462c0f9787a25d035b6c4450/scala/extensions/deps.bzl)
16+
- [scala/rules_scala-6.6.0.patch](https://github.com/EngFlow/example/blob/79b51930e4629486462c0f9787a25d035b6c4450/scala/rules_scala-6.6.0.patch)
17+
18+
You can view these files locally using:
19+
20+
```txt
21+
git show 79b5193:MODULE.bazel
22+
git show 79b5193:scala/extensions/config.bzl
23+
git show 79b5193:scala/extensions/deps.bzl
24+
git show 79b5193:scala/rules_scala-6.6.0.patch
25+
```
26+
27+
To see the content of the `scala/extensions` directory at that commit:
28+
29+
```sh
30+
$ git show 79b5193:scala/extensions
31+
tree 79b5193:scala/extensions
32+
33+
BUILD
34+
config.bzl
35+
deps.bzl
36+
```
37+
38+
[Bzlmod]: https://bazel.build/external/module
39+
[module extensions]: https://bazel.build/external/extension
40+
[rules_scala v7.0.0]: https://github.com/bazel-contrib/rules_scala/releases/tag/v7.0.0
41+
[post]: https://blog.engflow.com/2025/01/16/migrating-to-bazel-modules-aka-bzlmod---module-extensions/
42+
[series]: https://blog.engflow.com/category/bzlmod/

scala/extensions/config.bzl

-55
This file was deleted.

scala/extensions/deps.bzl

-12
This file was deleted.

scala/rules_scala-6.6.0.patch

-91
This file was deleted.

0 commit comments

Comments
 (0)