-
Notifications
You must be signed in to change notification settings - Fork 0
/
repository_configure.bzl
41 lines (35 loc) · 1.04 KB
/
repository_configure.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
def repository_configure(rctx, platform, version, label_prefix):
repo_path = str(rctx.path("")) + "/"
relative_path = "external/%s/" % rctx.name
substitutions = {
"%{repo_name}": rctx.name,
"%{repo_path}" : repo_path,
"%{tools_path}" : repo_path,
"%{relative_path}" : relative_path,
"%{platform}": platform,
"%{version}": version
}
rctx.template(
"BUILD",
Label(label_prefix + ":" + platform + "_BUILD.tpl"),
substitutions=substitutions,
executable=False
)
rctx.template(
"common.bzl",
Label(label_prefix + ":common.bzl.tpl"),
substitutions=substitutions,
executable=False
)
rctx.template(
"register.bzl",
Label(label_prefix + ":register.bzl.tpl"),
substitutions=substitutions,
executable=False
)
rctx.template(
"config.bzl",
Label(label_prefix + ":" + platform + "_config.bzl.tpl"),
substitutions=substitutions,
executable=False
)