Skip to content

Commit 43addd6

Browse files
committed
Use bazel_worker_java 0.0.6, strip_prefix
Drops `bazel_worker_api` from `MODULE.bazel` now that `bazel_worker_java` 0.0.6 depends on `bazel_worker_api` 0.0.6. Incorporates the `http_archive` and `strip_prefix` suggestion from @Wyverald in #1756.
1 parent 9d94e7c commit 43addd6

File tree

2 files changed

+12
-46
lines changed

2 files changed

+12
-46
lines changed

MODULE.bazel

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ single_version_override(
6666
version = "31.1",
6767
)
6868

69-
bazel_dep(name = "bazel_worker_api", version = "0.0.5")
70-
bazel_dep(name = "bazel_worker_java", version = "0.0.5")
69+
bazel_dep(name = "bazel_worker_java", version = "0.0.6")
7170

7271
scala_protoc = use_extension(
7372
"//scala/extensions:protoc.bzl",

scala/private/macros/workspace_compat.bzl

Lines changed: 11 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -9,58 +9,25 @@ already. Originally became necessary due to:
99
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
1010
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
1111

12-
_ALIAS_REPO_BUILD_FMT = """\
13-
package(default_visibility = ["//visibility:public"])
14-
15-
{aliases}"""
16-
17-
_ALIAS_FMT = """\
18-
alias(
19-
name = "{name}",
20-
actual = "{actual}",
21-
)
22-
"""
23-
24-
def _alias_repo_impl(repository_ctx):
25-
aliases = "\n".join([
26-
_ALIAS_FMT.format(name = name, actual = actual)
27-
for name, actual in repository_ctx.attr.aliases.items()
28-
])
29-
repository_ctx.file(
30-
"BUILD",
31-
_ALIAS_REPO_BUILD_FMT.format(aliases = aliases),
32-
executable = False,
33-
)
34-
35-
_alias_repo = repository_rule(
36-
implementation = _alias_repo_impl,
37-
attrs = {"aliases": attr.string_dict(mandatory = True)},
38-
)
39-
40-
def workspace_compat():
12+
def _bazel_worker_api_repo(name, strip_prefix):
4113
maybe(
4214
http_archive,
43-
name = "bazel-worker-api",
44-
sha256 = "07b5fa9c883558e378a00c67dae05a4dcb8d43cc12486722d6875224454a8a30",
15+
name = name,
16+
sha256 = "5aac6ae6a23015cc7984492a114dc539effc244ec5ac7f8f6b1539c15fb376eb",
4517
urls = [
46-
"https://mirror.bazel.build/github.com/bazelbuild/bazel-worker-api/releases/download/v0.0.5/bazel-worker-api-v0.0.5.tar.gz",
47-
"https://github.com/bazelbuild/bazel-worker-api/releases/download/v0.0.5/bazel-worker-api-v0.0.5.tar.gz",
18+
"https://github.com/bazelbuild/bazel-worker-api/releases/download/v0.0.6/bazel-worker-api-v0.0.6.tar.gz",
4819
],
49-
strip_prefix = "bazel-worker-api-0.0.5",
20+
strip_prefix = "bazel-worker-api-0.0.6/" + strip_prefix,
5021
)
5122

52-
maybe(
53-
_alias_repo,
23+
24+
def workspace_compat():
25+
_bazel_worker_api_repo(
5426
name = "bazel_worker_api",
55-
aliases = {
56-
"worker_protocol_proto": "@bazel-worker-api//proto:worker_protocol_proto",
57-
},
27+
strip_prefix = "proto",
5828
)
5929

60-
maybe(
61-
_alias_repo,
30+
_bazel_worker_api_repo(
6231
name = "bazel_worker_java",
63-
aliases = {
64-
"worker_protocol_java_proto": "@bazel-worker-api//java:worker_protocol_java_proto",
65-
},
32+
strip_prefix = "java",
6633
)

0 commit comments

Comments
 (0)