-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathBUILD.bazel
79 lines (68 loc) · 1.46 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
load("@buildifier_prebuilt//:rules.bzl", "buildifier", "buildifier_test")
load("@gazelle//:def.bzl", "gazelle", "gazelle_test")
load("@rules_multirun//:defs.bzl", "command", "multirun")
gazelle(name = "gazelle")
gazelle_test(
name = "gazelle_test",
workspace = "//:MODULE.bazel",
)
BUILDIFIER_EXCLUDES = [
"./.git/*",
"./.ijwb/*",
]
# Buildifier formats all Starlark files.
buildifier(
name = "buildifier",
exclude_patterns = BUILDIFIER_EXCLUDES,
lint_mode = "fix",
mode = "fix",
)
buildifier_test(
name = "buildifier_test",
exclude_patterns = BUILDIFIER_EXCLUDES,
lint_mode = "warn",
no_sandbox = True,
workspace = "//:MODULE.bazel",
)
# Shortcut for the Go SDK
alias(
name = "go",
actual = "@rules_go//go",
visibility = ["//visibility:public"],
)
alias(
name = "cue",
actual = "@org_cuelang_go//cmd/cue",
visibility = ["//visibility:public"],
)
command(
name = "go-mod-tidy",
arguments = [
"mod",
"tidy",
],
command = ":go",
)
# Shortcut to update go.mod, gazelle files and formatting.
multirun(
name = "tidy",
commands = [
":go-mod-tidy",
":gazelle",
":buildifier",
],
)
platform(
name = "linux_x86",
constraint_values = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
)
platform(
name = "linux_arm64",
constraint_values = [
"@platforms//os:linux",
"@platforms//cpu:arm64",
],
)