-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Copy pathBUILD.bazel
52 lines (48 loc) · 1.37 KB
/
BUILD.bazel
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
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
_oses = ("linux", "macos")
alias(
name = "dir",
actual = select({"@platforms//os:" + os: "@swift-resource-dir-%s//file" % os for os in _oses}),
target_compatible_with = select({
"@platforms//os:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
visibility = ["//visibility:public"],
)
alias(
name = "prebuilt",
actual = select({"@platforms//os:" + os: "@swift-prebuilt-%s//:swift-llvm-support" % os for os in _oses}),
target_compatible_with = select({
"@platforms//os:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
visibility = ["//visibility:public"],
)
[
sh_binary(
name = "update-%s-%s" % (what, os),
srcs = ["update.sh"],
args = [
"$(rlocationpath %s)" % source,
"$(rlocationpath %s)" % target,
],
data = [
source,
target,
],
deps = ["//misc/bazel:sh_runfiles"],
)
for os in _oses
for what, source, target in (
(
"prebuilt",
"@swift-prebuilt-%s-download-only//file" % os,
"swift-prebuilt-%s.tar.zst" % os,
),
(
"dir",
"@swift-resource-dir-%s//file" % os,
"resource-dir-%s.zip" % os,
),
)
]