-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathBUILD.bazel
58 lines (52 loc) · 1.61 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
53
54
55
56
57
58
load("@bazel_gazelle//:def.bzl", "gazelle", "gazelle_binary")
# TODO: Fix config system import structure
# load("@rules_python_gazelle_plugin//:def.bzl", "GAZELLE_PYTHON_RUNTIME_DEPS")
# gazelle:exclude blueprint
# gazelle:exclude example
# gazelle:prefix github.com/ARM-software/bob-build/
gazelle_binary(
name = "gazelle_binary",
languages = [
"@bazel_gazelle//language/go",
"@bazel_gazelle//language/proto",
# TODO: Fix config system import structure
# "@rules_python_gazelle_plugin//python",
],
visibility = ["//visibility:public"],
)
gazelle(
name = "gazelle",
# TODO: Fix config system import structure
# data = GAZELLE_PYTHON_RUNTIME_DEPS,
gazelle = ":gazelle_binary",
)
gazelle(
name = "gazelle-update-repos",
args = [
"-from_file=go.mod",
"-to_macro=deps.bzl%go_dependencies",
"-prune",
"-build_file_proto_mode=disable_global",
],
command = "update-repos",
)
# By default, bazel run executes the binary in the sandbox with its runfiles.
# This breaks the pre-commit convention which uses relative paths from workspace root.
# This wrapper captures the location of the needed binary and changes dir to the working
# directory before calling bpfmt.
py_binary(
name = "bpfmt_wrapper",
srcs = [
"bpfmt_wrapper.py",
],
args = [
"--bpfmt",
"$(rlocationpath @com_github_google_blueprint//bpfmt)",
],
data = ["@com_github_google_blueprint//bpfmt"],
main = "bpfmt_wrapper.py",
visibility = ["//visibility:public"],
deps = [
"@rules_python//python/runfiles",
],
)