-
Notifications
You must be signed in to change notification settings - Fork 91
Expand file tree
/
Copy pathMODULE.bazel
More file actions
140 lines (124 loc) · 4.24 KB
/
MODULE.bazel
File metadata and controls
140 lines (124 loc) · 4.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
module(
name = "rules_java",
version = "0.0.0",
bazel_compatibility = [">=7.0.0"],
compatibility_level = 1,
)
bazel_dep(name = "platforms", version = "0.0.11")
bazel_dep(name = "rules_cc", version = "0.2.13")
archive_override(
module_name = "rules_cc",
integrity = "sha256-y3RA9zEyB7HqBXVTgrlFmvfJARcEDzILe2ugNGC4ZrE=",
strip_prefix = "rules_cc-b5a65591334f74371f4d75003768957a740cd868",
urls = ["https://github.com/bazelbuild/rules_cc/archive/b5a65591334f74371f4d75003768957a740cd868.tar.gz"],
)
bazel_dep(name = "bazel_features", version = "1.30.0")
bazel_dep(name = "bazel_skylib", version = "1.6.1")
bazel_dep(name = "protobuf", version = "32.1", repo_name = "com_google_protobuf")
bazel_dep(name = "zlib", version = "1.3.1.bcr.5")
# Required by @remote_java_tools, which is loaded via module extension.
bazel_dep(name = "rules_license", version = "0.0.3")
bazel_dep(name = "abseil-cpp", version = "20250814.1", repo_name = "com_google_absl")
bazel_dep(name = "re2", version = "2025-11-05.bcr.1")
single_version_override(
module_name = "protobuf",
patch_strip = 1,
patches = [
"//third_party:protobuf_load-cc-rules.patch",
],
version = "32.1",
)
register_toolchains("//toolchains:all")
toolchains = use_extension("//java:extensions.bzl", "toolchains")
# Declare remote java tools repos
use_repo(toolchains, "remote_java_tools")
use_repo(toolchains, "remote_java_tools_linux")
use_repo(toolchains, "remote_java_tools_linux_aarch64")
use_repo(toolchains, "remote_java_tools_windows")
use_repo(toolchains, "remote_java_tools_darwin_x86_64")
use_repo(toolchains, "remote_java_tools_darwin_arm64")
# Declare local jdk repo
use_repo(toolchains, "local_jdk")
register_toolchains(
"@local_jdk//:runtime_toolchain_definition",
"@local_jdk//:bootstrap_runtime_toolchain_definition",
)
# Declare all remote jdk toolchain config repos
JDKS = {
# Must match JDK repos defined in remote_jdk8_repos()
"8": [
"linux",
"linux_aarch64",
"linux_s390x",
"macos",
"macos_aarch64",
"windows",
],
# Must match JDK repos defined in remote_jdk11_repos()
"11": [
"linux",
"linux_aarch64",
"linux_ppc64le",
"linux_s390x",
"macos",
"macos_aarch64",
"win",
"win_arm64",
],
# Must match JDK repos defined in remote_jdk17_repos()
"17": [
"linux",
"linux_aarch64",
"linux_ppc64le",
"linux_s390x",
"macos",
"macos_aarch64",
"win",
"win_arm64",
],
# Must match JDK repos defined in remote_jdk21_repos()
"21": [
"linux",
"linux_aarch64",
"linux_ppc64le",
"linux_riscv64",
"linux_s390x",
"macos",
"macos_aarch64",
"win",
"win_arm64",
],
"25": [
"linux",
"linux_aarch64",
"linux_ppc64le",
"linux_riscv64",
"linux_s390x",
"macos",
"macos_aarch64",
"win",
"win_arm64",
],
}
REMOTE_JDK_REPOS = [(("remote_jdk" if version == "8" else "remotejdk") + version + "_" + platform) for version in JDKS for platform in JDKS[version]]
[use_repo(
toolchains,
repo + "_toolchain_config_repo",
) for repo in REMOTE_JDK_REPOS]
[register_toolchains("@" + name + "_toolchain_config_repo//:all") for name in REMOTE_JDK_REPOS]
# Compatibility layer
compat = use_extension("//java:rules_java_deps.bzl", "compatibility_proxy")
use_repo(compat, "compatibility_proxy")
# Dev dependencies
bazel_dep(name = "rules_pkg", version = "0.9.1", dev_dependency = True)
bazel_dep(name = "stardoc", version = "0.8.0", dev_dependency = True)
bazel_dep(name = "rules_shell", version = "0.2.0", dev_dependency = True)
bazel_dep(name = "rules_testing", dev_dependency = True)
archive_override(
module_name = "rules_testing",
integrity = "sha256-d/94Ix5IoGXk9rP1HjYKxPMH8ccwX5b1Qxs8BKg4WRg=",
strip_prefix = "rules_testing-ac97ba507116056cd489161b5e99dd8014685adc",
urls = ["https://github.com/bazelbuild/rules_testing/archive/ac97ba507116056cd489161b5e99dd8014685adc.tar.gz"],
)
test_repositories = use_extension("//test:repositories.bzl", "test_repositories_ext", dev_dependency = True)
use_repo(test_repositories, "guava", "truth")