-
Notifications
You must be signed in to change notification settings - Fork 36
/
BUCK
56 lines (48 loc) · 1.48 KB
/
BUCK
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
load("@prelude//:none.bzl", "none_rule")
load("@prelude//utils:source_listing.bzl", "source_listing")
load(":native.bzl", prelude = "native")
oncall("build_infra")
source_listing(exclude = [
# Exclude PACKAGE file using modifiers since those are not enabled everywhere yet.
"PACKAGE",
])
# Done to avoid triggering a lint rule that replaces glob with an fbcode macro
globby = glob
srcs = globby(
["**"],
# Context: https://fb.workplace.com/groups/buck2users/posts/3121903854732641/
exclude = [
"**/.pyre_configuration.local",
# Unfortunately, using modifiers require loading bzl files in outside of prelude,
# and that currently breaks isolated tests that attempt to grab a best-effort prelude
# from the filegroup below.
# TODO: Switch these tests to use the bundled prelude instead.
"PACKAGE",
],
)
# Re-export filegroups that are behind package boundary violations for
# Buck2.
prelude.filegroup(
name = "files",
srcs = srcs,
visibility = ["PUBLIC"],
)
# Tests want BUCK.v2 instead of TARGETS.v2
prelude.genrule(
name = "copy_android_constraint",
out = "BUCK.v2",
cmd = "cp $(location prelude//android/constraints:files)/TARGETS.v2 $OUT",
visibility = ["PUBLIC"],
)
prelude.filegroup(
name = "prelude",
srcs = {
"": ":files",
"android/constraints/BUCK.v2": ":copy_android_constraint",
},
visibility = ["PUBLIC"],
)
none_rule(
name = "none",
visibility = ["PUBLIC"],
)