forked from kythe/kythe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.bzl
205 lines (185 loc) · 7.93 KB
/
setup.bzl
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
def github_archive(name, repo_name, commit, kind = "zip", strip_prefix = "", **kwargs):
"""Defines a GitHub commit-based repository rule."""
project = repo_name[repo_name.index("/"):]
if "sha256" in kwargs:
print("Ignoring unstable GitHub sha256 argument in", name)
kwargs.pop("sha256")
http_archive(
name = name,
strip_prefix = "{project}-{commit}/{prefix}".format(
project = project,
commit = commit,
prefix = strip_prefix,
),
urls = [u.format(commit = commit, repo_name = repo_name, kind = kind) for u in [
"https://mirror.bazel.build/github.com/{repo_name}/archive/{commit}.{kind}",
"https://github.com/{repo_name}/archive/{commit}.{kind}",
]],
canonical_id = commit,
**kwargs
)
def kythe_rule_repositories():
"""Defines external repositories for Kythe Bazel rules.
These repositories must be loaded before calling external.bzl%kythe_dependencies.
"""
maybe(
http_archive,
name = "platforms",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz",
"https://github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz",
],
sha256 = "8150406605389ececb6da07cbcb509d5637a3ab9a24bc69b1101531367d89d74",
)
maybe(
http_archive,
name = "bazel_skylib",
urls = [
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.2/bazel-skylib-1.4.2.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.4.2/bazel-skylib-1.4.2.tar.gz",
],
sha256 = "66ffd9315665bfaafc96b52278f57c7e2dd09f5ede279ea6d39b2be471e7e3aa",
)
maybe(
http_archive,
name = "io_bazel_rules_go",
sha256 = "278b7ff5a826f3dc10f04feaf0b70d48b68748ccd512d7f98bf442077f043fe3",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.41.0/rules_go-v0.41.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.41.0/rules_go-v0.41.0.zip",
],
)
maybe(
http_archive,
name = "rules_cc",
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"],
sha256 = "2037875b9a4456dce4a79d112a8ae885bbc4aad968e6587dca6e64f3a0900cdf",
strip_prefix = "rules_cc-0.0.9",
)
maybe(
http_archive,
name = "rules_java",
urls = [
# Note: when updating rules_java, please check if the ModuleName check in tools/javacopts.bazelrc can be re-enabled.
"https://mirror.bazel.build/github.com/bazelbuild/rules_java/releases/download/6.5.2/rules_java-6.5.2.tar.gz",
"https://github.com/bazelbuild/rules_java/releases/download/6.5.2/rules_java-6.5.2.tar.gz",
],
sha256 = "16bc94b1a3c64f2c36ceecddc9e09a643e80937076b97e934b96a8f715ed1eaa",
)
maybe(
http_archive,
name = "rules_proto",
sha256 = "71fdbed00a0709521ad212058c60d13997b922a5d01dbfd997f0d57d689e7b67",
strip_prefix = "rules_proto-6.0.0-rc2",
url = "https://github.com/bazelbuild/rules_proto/releases/download/6.0.0-rc2/rules_proto-6.0.0-rc2.tar.gz",
)
maybe(
http_archive,
name = "bazel_gazelle",
sha256 = "29218f8e0cebe583643cbf93cae6f971be8a2484cdcfa1e45057658df8d54002",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.32.0/bazel-gazelle-v0.32.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.32.0/bazel-gazelle-v0.32.0.tar.gz",
],
patch_args = ["-p1"],
patches = [
# Add support for per-file go_test targets.
"//third_party:gazelle-0.32.0-go_test_mode.patch",
],
)
maybe(
http_archive,
name = "aspect_rules_js",
sha256 = "7ab9776bcca823af361577a1a2ebb9a30d2eb5b94ecc964b8be360f443f714b2",
strip_prefix = "rules_js-1.32.6",
url = "https://github.com/aspect-build/rules_js/releases/download/v1.32.6/rules_js-v1.32.6.tar.gz",
)
maybe(
http_archive,
name = "rules_jvm_external",
sha256 = "f86fd42a809e1871ca0aabe89db0d440451219c3ce46c58da240c7dcdc00125f",
strip_prefix = "rules_jvm_external-5.2",
urls = ["https://github.com/bazelbuild/rules_jvm_external/releases/download/5.2/rules_jvm_external-5.2.tar.gz"],
)
maybe(
http_archive,
name = "aspect_rules_ts",
sha256 = "bd3e7b17e677d2b8ba1bac3862f0f238ab16edb3e43fb0f0b9308649ea58a2ad",
strip_prefix = "rules_ts-2.1.0",
url = "https://github.com/aspect-build/rules_ts/releases/download/v2.1.0/rules_ts-v2.1.0.tar.gz",
)
maybe(
http_archive,
name = "aspect_rules_jasmine",
sha256 = "4c16ef202d1e53fd880e8ecc9e0796802201ea9c89fa32f52d5d633fff858cac",
strip_prefix = "rules_jasmine-1.1.1",
url = "https://github.com/aspect-build/rules_jasmine/releases/download/v1.1.1/rules_jasmine-v1.1.1.tar.gz",
)
maybe(
http_archive,
name = "rules_python",
sha256 = "e5470e92a18aa51830db99a4d9c492cc613761d5bdb7131c04bd92b9834380f6",
strip_prefix = "rules_python-4b84ad270387a7c439ebdccfd530e2339601ef27",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_python/archive/4b84ad270387a7c439ebdccfd530e2339601ef27.tar.gz",
"https://github.com/bazelbuild/rules_python/archive/4b84ad270387a7c439ebdccfd530e2339601ef27.tar.gz",
],
)
maybe(
http_archive,
name = "rules_rust",
sha256 = "db89135f4d1eaa047b9f5518ba4037284b43fc87386d08c1d1fe91708e3730ae",
urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.27.0/rules_rust-v0.27.0.tar.gz"],
)
maybe(
http_archive,
name = "bazelruby_rules_ruby",
strip_prefix = "rules_ruby-0.4.1",
sha256 = "abfc2758cc379e0ff0eb9824e3b507c1633d4c8f99f24735aef63c7180be50f0",
urls = [
"https://github.com/bazelruby/rules_ruby/archive/v0.4.1.zip",
],
patches = [
"@io_kythe//third_party:rules_ruby_allow_empty.patch",
],
patch_args = ["-p1"],
)
maybe(
http_archive,
name = "rules_foreign_cc",
sha256 = "e60cfd0a8426fa4f5fd2156e768493ca62b87d125cb35e94c44e79a3f0d8635f",
strip_prefix = "rules_foreign_cc-0.2.0",
url = "https://github.com/bazelbuild/rules_foreign_cc/archive/0.2.0.zip",
)
maybe(
github_archive,
repo_name = "llvm/llvm-project",
commit = "45726c1a3a3d89ff9f6ebe657c3cb7bcd59b88db",
name = "llvm-raw",
build_file_content = "#empty",
patch_args = ["-p1"],
patches = ["@io_kythe//third_party:llvm-bazel-glob.patch"],
)
maybe(
github_archive,
repo_name = "hedronvision/bazel-compile-commands-extractor",
name = "hedron_compile_commands",
commit = "d6734f1d7848800edc92de48fb9d9b82f2677958",
)
# proto_library, cc_proto_library, and java_proto_library rules implicitly
# depend on @com_google_protobuf for protoc and proto runtimes.
# Note that if you update protobuf, you must also update some generated
# proto files:
# bazel run //kythe/proto:update
maybe(
http_archive,
name = "com_google_protobuf",
sha256 = "8ff511a64fc46ee792d3fe49a5a1bcad6f7dc50dfbba5a28b0e5b979c17f9871",
strip_prefix = "protobuf-25.2",
urls = [
"https://github.com/protocolbuffers/protobuf/releases/download/v25.2/protobuf-25.2.tar.gz",
],
repo_mapping = {"@zlib": "@net_zlib"},
)