forked from stackb/rules_proto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
81 lines (72 loc) · 2.3 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
load("@bazel_gazelle//:def.bzl", "gazelle", "gazelle_binary")
load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier")
load("@npm_ts_proto//:defs.bzl", "npm_link_all_packages")
load("@//rules:proto_gazelle.bzl", "proto_gazelle")
exports_files(["rules_proto_config.yaml"])
# ----------------------------------------------------
# Buildifier
# ----------------------------------------------------
buildifier(name = "buildifier")
# ----------------------------------------------------
# Gazelle
# ----------------------------------------------------
# gazelle:prefix github.com/stackb/rules_proto
# gazelle:resolve go github.com/bazelbuild/buildtools/build @com_github_bazelbuild_buildtools//build:go_default_library
# gazelle:exclude vendor
# gazelle:exclude node_modules
gazelle_binary(
name = "gazelle-protobuf",
languages = [
# NOTE: order matters here. Gazelle will respect the ordering of
# languages which will impact the population of 'OtherGen', so
# //language/protobuf MUST come after language/proto.
"@bazel_gazelle//language/go",
"@bazel_gazelle//language/proto",
"//language/protobuf",
],
visibility = ["//visibility:public"],
)
proto_gazelle(
name = "gazelle",
cfgs = [":rules_proto_config.yaml"],
gazelle = ":gazelle-protobuf",
imports = [
"@googleapis//:imports.csv",
"@protoapis//:imports.csv",
],
)
gazelle(
name = "update_go_deps",
args = [
"-from_file=go.mod",
"-to_macro=go_deps.bzl%go_deps",
"-build_file_proto_mode=disable_global",
"-prune=true",
],
command = "update-repos",
)
# ----------------------------------------------------
# Test-Related
# ----------------------------------------------------
filegroup(
name = "all_files",
testonly = True,
srcs = [
"BUILD.bazel",
"WORKSPACE",
"go_deps.bzl",
"//cmd/gazelle:all_files",
"//cmd/gencopy:all_files",
"//deps:all_files",
"//language/protobuf:all_files",
"//pkg:all_files",
"//plugin:all_files",
"//rules:all_files",
"//third_party:all_files",
"//toolchain:all_files",
] + glob(["vendor/**/*"]),
visibility = ["//visibility:public"],
)
npm_link_all_packages(
name = "node_modules",
)