forked from envoyproxy/apt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchives.bzl
24 lines (22 loc) · 821 Bytes
/
archives.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
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def load_github_archives(versions):
for k, v in versions.items():
if type(v) == type("") or v.get("type") != "github_archive":
continue
kwargs = dict(name = k, **v)
http_archive(
**{
k: (
(v.format(**kwargs) if not k.startswith("patch") else v)
if type(v) == "string"
else [
_v.format(**kwargs) if not k.startswith("patch") else _v
for _v in v
]
)
for k, v in kwargs.items()
if k not in ["repo", "type", "version"]
}
)
def archives(versions):
load_github_archives(versions)