Skip to content

Commit 1808ec8

Browse files
Release: https://github.com/bazel-contrib/rules_scala/releases/tag/v7.0.0 _Automated by [Publish to BCR](https://github.com/bazel-contrib/publish-to-bcr)_ --------- Co-authored-by: alexeagle <[email protected]> Co-authored-by: Alex Eagle <[email protected]>
1 parent 188e7be commit 1808ec8

File tree

5 files changed

+364
-0
lines changed

5 files changed

+364
-0
lines changed
Lines changed: 304 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,304 @@
1+
"""Bazel module definition for rules_scala"""
2+
3+
module(
4+
name = "rules_scala",
5+
version = "7.0.0",
6+
bazel_compatibility = [">=7.1.0"],
7+
compatibility_level = 7,
8+
)
9+
10+
SCALA_VERSION = "2.12.20"
11+
12+
# These versions match those required by some tests, including
13+
# test_thirdparty_version.sh.
14+
SCALA_2_VERSIONS = [
15+
"2.11.12",
16+
"2.12.20",
17+
"2.13.16",
18+
]
19+
20+
SCALA_3_VERSIONS = [
21+
"3.1.3",
22+
"3.3.6",
23+
"3.5.2",
24+
"3.6.4",
25+
"3.7.0",
26+
]
27+
28+
SCALA_VERSIONS = SCALA_2_VERSIONS + SCALA_3_VERSIONS
29+
30+
bazel_dep(name = "bazel_skylib", version = "1.6.0")
31+
single_version_override(
32+
module_name = "bazel_skylib",
33+
version = "1.7.1",
34+
)
35+
36+
bazel_dep(name = "platforms", version = "0.0.9")
37+
single_version_override(
38+
module_name = "platforms",
39+
version = "0.0.11",
40+
)
41+
42+
bazel_dep(name = "rules_java", version = "7.6.0")
43+
single_version_override(
44+
module_name = "rules_java",
45+
version = "8.11.0",
46+
)
47+
48+
bazel_dep(name = "rules_proto", version = "6.0.0")
49+
single_version_override(
50+
module_name = "rules_proto",
51+
version = "7.1.0",
52+
)
53+
54+
bazel_dep(
55+
name = "protobuf",
56+
version = "28.2",
57+
repo_name = "com_google_protobuf",
58+
)
59+
60+
# Temporarily required for `protoc` toolchainization until resolution of
61+
# protocolbuffers/protobuf#19679.
62+
single_version_override(
63+
module_name = "protobuf",
64+
patch_strip = 1,
65+
patches = ["//protoc:0001-protobuf-19679-rm-protoc-dep.patch"],
66+
version = "30.2",
67+
)
68+
69+
scala_protoc = use_extension(
70+
"//scala/extensions:protoc.bzl",
71+
"scala_protoc",
72+
dev_dependency = True,
73+
)
74+
use_repo(scala_protoc, "rules_scala_protoc_toolchains")
75+
76+
scala_config = use_extension(
77+
"//scala/extensions:config.bzl",
78+
"scala_config",
79+
)
80+
use_repo(scala_config, "rules_scala_config")
81+
82+
dev_config = use_extension(
83+
"//scala/extensions:config.bzl",
84+
"scala_config",
85+
dev_dependency = True,
86+
)
87+
dev_config.settings(
88+
enable_compiler_dependency_tracking = True,
89+
scala_version = SCALA_VERSION,
90+
scala_versions = SCALA_VERSIONS,
91+
)
92+
93+
scala_deps = use_extension("//scala/extensions:deps.bzl", "scala_deps")
94+
use_repo(
95+
scala_deps,
96+
"rules_scala_toolchains",
97+
"scala_compiler_sources",
98+
)
99+
100+
# Register some of our testing toolchains first when building our repo.
101+
register_toolchains(
102+
# This is optional, but still safe to include even when not using
103+
# `--incompatible_enable_proto_toolchain_resolution`. Requires invoking the
104+
# `scala_protoc_toolchains` repo rule. Register this toolchain before any
105+
# others.
106+
"@rules_scala_protoc_toolchains//...:all",
107+
"//scala:unused_dependency_checker_error_toolchain",
108+
"//test/proto:scalapb_toolchain",
109+
"//test/toolchains:java21_toolchain_definition",
110+
dev_dependency = True,
111+
)
112+
113+
register_toolchains("@rules_scala_toolchains//...:all")
114+
115+
# Dev dependencies
116+
117+
dev_deps = use_extension(
118+
"//scala/extensions:deps.bzl",
119+
"scala_deps",
120+
dev_dependency = True,
121+
)
122+
dev_deps.scala()
123+
dev_deps.jmh()
124+
dev_deps.junit()
125+
dev_deps.scala_proto()
126+
dev_deps.scalafmt()
127+
dev_deps.scalatest()
128+
dev_deps.specs2()
129+
dev_deps.twitter_scrooge()
130+
use_repo(
131+
dev_deps,
132+
"scala_proto_rules_scalapb_compilerplugin",
133+
"scala_proto_rules_scalapb_protoc_bridge",
134+
)
135+
136+
# Default versions of version specific repos needed by some of our tests. Tests
137+
# that set `--repo_env=SCALA_VERSION=...` break without using the default here,
138+
# because version specific repos for other versions won't be available.
139+
use_repo(
140+
dev_deps,
141+
"io_bazel_rules_scala_guava",
142+
"io_bazel_rules_scala_junit_junit",
143+
"io_bazel_rules_scala_scala_compiler",
144+
"io_bazel_rules_scala_scala_library",
145+
)
146+
147+
[
148+
[
149+
use_repo(dev_deps, dep + "_" + scala_version.replace(".", "_"))
150+
for dep in [
151+
"io_bazel_rules_scala_junit_junit",
152+
"io_bazel_rules_scala_scala_compiler",
153+
"io_bazel_rules_scala_scala_library",
154+
] + (
155+
# We can remove this condition once we drop support for Scala 2.11.
156+
[] if scala_version.startswith("2.11.") else [
157+
"scala_proto_rules_scalapb_protoc_gen",
158+
]
159+
)
160+
]
161+
for scala_version in SCALA_VERSIONS
162+
]
163+
164+
[
165+
[
166+
use_repo(dev_deps, dep + "_" + scala_version.replace(".", "_"))
167+
for dep in [
168+
"io_bazel_rules_scala_scala_reflect",
169+
]
170+
]
171+
for scala_version in SCALA_2_VERSIONS
172+
]
173+
174+
[
175+
[
176+
use_repo(dev_deps, dep + "_" + scala_version.replace(".", "_"))
177+
for dep in [
178+
"io_bazel_rules_scala_scala_compiler_2",
179+
"io_bazel_rules_scala_scala_library_2",
180+
"io_bazel_rules_scala_scala_reflect_2",
181+
]
182+
]
183+
for scala_version in SCALA_3_VERSIONS
184+
]
185+
186+
internal_dev_deps = use_extension(
187+
"//scala/private/extensions:dev_deps.bzl",
188+
"dev_deps",
189+
dev_dependency = True,
190+
)
191+
192+
# See //scala/private:extensions/dev_deps.bzl for notes on some of these repos.
193+
use_repo(
194+
internal_dev_deps,
195+
"com_github_bazelbuild_buildtools",
196+
"com_github_jnr_jffi_native",
197+
"com_google_guava_guava_21_0",
198+
"com_google_guava_guava_21_0_with_file",
199+
"com_twitter__scalding_date",
200+
"org_apache_commons_commons_lang_3_5",
201+
"org_apache_commons_commons_lang_3_5_without_file",
202+
"org_springframework_spring_core",
203+
"org_springframework_spring_tx",
204+
"org_typelevel__cats_core",
205+
"org_typelevel_kind_projector",
206+
)
207+
208+
java_toolchains = use_extension(
209+
"@rules_java//java:extensions.bzl",
210+
"toolchains",
211+
dev_dependency = True,
212+
)
213+
use_repo(
214+
java_toolchains,
215+
# //test/toolchains:java21_toolchain
216+
"remotejdk21_linux",
217+
"remotejdk21_macos",
218+
"remotejdk21_win",
219+
# //test/jmh:test_jmh_jdk8
220+
"remote_jdk8_linux",
221+
"remote_jdk8_macos",
222+
"remote_jdk8_windows",
223+
)
224+
225+
[
226+
(
227+
bazel_dep(name = name, dev_dependency = True),
228+
local_path_override(
229+
module_name = name,
230+
path = path,
231+
),
232+
)
233+
for name, path in [
234+
(
235+
"proto_cross_repo_boundary",
236+
"test/proto_cross_repo_boundary/repo",
237+
),
238+
(
239+
"test_new_local_repo",
240+
"third_party/test/new_local_repo",
241+
),
242+
(
243+
"example_external_workspace",
244+
"third_party/test/example_external_workspace",
245+
),
246+
]
247+
]
248+
249+
bazel_dep(
250+
name = "bazel_ci_rules",
251+
version = "1.0.0",
252+
dev_dependency = True,
253+
repo_name = "bazelci_rules",
254+
)
255+
bazel_dep(
256+
name = "rules_go",
257+
version = "0.54.0",
258+
dev_dependency = True,
259+
repo_name = "io_bazel_rules_go", # for com_github_bazelbuild_buildtools
260+
)
261+
bazel_dep(name = "gazelle", version = "0.43.0", dev_dependency = True)
262+
263+
go_sdk = use_extension(
264+
"@io_bazel_rules_go//go:extensions.bzl",
265+
"go_sdk",
266+
dev_dependency = True,
267+
)
268+
go_sdk.download(version = "1.24.2")
269+
270+
go_deps = use_extension(
271+
"@gazelle//:extensions.bzl",
272+
"go_deps",
273+
dev_dependency = True,
274+
)
275+
276+
# The go_deps.module calls are inspired by the following to get the
277+
# com_github_bazelbuild_buildtools repo to work:
278+
#
279+
# - https://github.com/bazelbuild/bazel-central-registry/blob/main/modules/gazelle/0.39.1/MODULE.bazel#L31-L57
280+
#
281+
# To get the latest version and hashes for each per:
282+
#
283+
# - https://go.dev/ref/mod#go-list-m
284+
# - https://go.dev/ref/mod#checksum-database
285+
#
286+
# go list -m golang.org/x/tools@latest
287+
# curl https://sum.golang.org/lookup/golang.org/x/[email protected]
288+
go_deps.module(
289+
path = "golang.org/x/tools",
290+
sum = "h1:4qz2S3zmRxbGIhDIAgjxvFutSvH5EfnsYrRBj0UI0bc=",
291+
version = "v0.33.0",
292+
)
293+
go_deps.module(
294+
path = "github.com/golang/protobuf",
295+
sum = "h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=",
296+
version = "v1.5.4",
297+
)
298+
use_repo(
299+
go_deps,
300+
"com_github_golang_protobuf",
301+
"org_golang_x_tools",
302+
)
303+
304+
bazel_dep(name = "rules_python", version = "1.4.0", dev_dependency = True)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"mediaType": "application/vnd.build.bazel.registry.attestation+json;version=1.0.0",
3+
"attestations": {
4+
"source.json": {
5+
"url": "https://github.com/bazel-contrib/rules_scala/releases/download/v7.0.0/source.json.intoto.jsonl",
6+
"integrity": "sha256-tNJCY5AQ/S9ufHGJkNCU090ESrVoWtD35BKHt129NAo="
7+
},
8+
"MODULE.bazel": {
9+
"url": "https://github.com/bazel-contrib/rules_scala/releases/download/v7.0.0/MODULE.bazel.intoto.jsonl",
10+
"integrity": "sha256-N5/ITVmJxQrR5WhBGaPDtocb8UfdnJyLV6VRubEgZRQ="
11+
},
12+
"rules_scala-v7.0.0.tar.gz": {
13+
"url": "https://github.com/bazel-contrib/rules_scala/releases/download/v7.0.0/rules_scala-v7.0.0.tar.gz.intoto.jsonl",
14+
"integrity": "sha256-ipBXVqzqowW/jP8PfaED0ZyMbW+B68YXlTYJ+t8hzCQ="
15+
}
16+
}
17+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
bcr_test_module:
2+
module_path: "examples/crossbuild"
3+
matrix:
4+
platform: ["debian10", "macos", "ubuntu2004"]
5+
bazel: [7.x, 8.x, rolling, last_green]
6+
tasks:
7+
run_tests:
8+
name: "Build and test the example module"
9+
platform: ${{ platform }}
10+
bazel: ${{ bazel }}
11+
build_targets:
12+
- "//..."
13+
test_targets:
14+
- "//..."

modules/rules_scala/7.0.0/source.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"integrity": "sha256-pHANbmzfE8+F4pAp7JmOLsO6lHkWBuyD0sluPFsK6+0=",
3+
"strip_prefix": "rules_scala-7.0.0",
4+
"url": "https://github.com/bazel-contrib/rules_scala/releases/download/v7.0.0/rules_scala-v7.0.0.tar.gz"
5+
}

modules/rules_scala/metadata.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"homepage": "https://github.com/bazelbuild/rules_scala",
3+
"maintainers": [
4+
{
5+
"name": "Simonas Pinevičius",
6+
"email": "[email protected]",
7+
"github": "simuons",
8+
"github_user_id": 1047879
9+
},
10+
{
11+
"name": "Vaidas Pilkauskas",
12+
"email": "[email protected]",
13+
"github": "liucijus",
14+
"github_user_id": 1623634
15+
}
16+
],
17+
"repository": [
18+
"github:bazel-contrib/rules_scala"
19+
],
20+
"versions": [
21+
"7.0.0"
22+
],
23+
"yanked_versions": {}
24+
}

0 commit comments

Comments
 (0)