-
Notifications
You must be signed in to change notification settings - Fork 381
/
BUILD.bazel
133 lines (123 loc) · 3.26 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
load("@bazel_gazelle_is_bazel_module//:defs.bzl", "GAZELLE_IS_BAZEL_MODULE")
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@io_bazel_rules_go//go:def.bzl", "go_cross_binary", "nogo")
load("//:def.bzl", "gazelle", "gazelle_binary")
# gazelle:prefix github.com/bazelbuild/bazel-gazelle
# gazelle:exclude vendor
# gazelle:exclude third_party
# gazelle:exclude .bazelci
# gazelle:exclude .bcr
# gazelle:exclude .idea
# gazelle:exclude .ijwb
# gazelle:exclude .github
# gazelle:exclude .vscode
# gazelle:exclude internal/module/testdata
# gazelle:go_naming_convention import_alias
gazelle(
name = "gazelle",
command = "fix",
gazelle = ":gazelle_local",
)
# gazelle_ci is called from CI to verify the repo is up-to-date, see: .bazelci/presubmit.yml
gazelle(
name = "gazelle_ci",
command = "fix",
extra_args = ["--mode=diff"],
gazelle = ":gazelle_local",
)
gazelle_binary(
name = "gazelle_local",
languages = [
"//language/proto",
"//language/go",
"//internal/language/test_filegroup",
"@bazel_skylib_gazelle_plugin//bzl" if GAZELLE_IS_BAZEL_MODULE else "@bazel_skylib//gazelle/bzl",
],
)
go_cross_binary(
name = "gazelle_local_go1.22",
sdk_version = "1.22",
target = ":gazelle_local",
)
nogo(
name = "nogo",
vet = True,
visibility = ["//visibility:public"],
deps = ["@org_golang_x_tools//go/analysis/passes/copylock"],
)
exports_files([
"WORKSPACE",
"extend.md",
"repository.md",
])
filegroup(
name = "all_files",
testonly = True,
# keep
srcs = glob(["vendor/**"]) + [
".bazelrc",
".gitignore",
"AUTHORS",
"BUILD.bazel",
"CODEOWNERS",
"CONTRIBUTING.md",
"CONTRIBUTORS",
"Design.rst",
"LICENSE",
"README.rst",
"WORKSPACE",
"def.bzl",
"deps.bzl",
"extend.rst",
"go.mod",
"go.sum",
"repository.rst",
"//cmd:all_files",
"//config:all_files",
"//flag:all_files",
"//internal:all_files",
"//label:all_files",
"//language:all_files",
"//merger:all_files",
"//pathtools:all_files",
"//repo:all_files",
"//resolve:all_files",
"//rule:all_files",
"//testtools:all_files",
"//tools:all_files",
"//walk:all_files",
],
visibility = ["//visibility:public"],
)
bzl_library(
name = "def",
srcs = ["def.bzl"],
visibility = ["//visibility:public"],
deps = [
"//internal:gazelle_binary",
"//internal:go_repository",
"//internal:overlay_repository",
"//internal/generationtest",
"@bazel_gazelle_is_bazel_module//:defs",
"@bazel_skylib//lib:shell",
],
)
bzl_library(
name = "deps",
srcs = ["deps.bzl"],
visibility = ["//visibility:public"],
deps = [
"//internal:go_repository",
"//internal:go_repository_cache",
"//internal:go_repository_config",
"//internal:go_repository_tools",
"//internal:is_bazel_module",
"@bazel_tools//tools/build_defs/repo:git.bzl",
],
)
bzl_library(
name = "extensions",
srcs = ["extensions.bzl"],
visibility = ["//visibility:public"],
deps = ["//internal/bzlmod:go_deps"],
)