This repository has been archived by the owner on Jun 17, 2023. It is now read-only.
forked from stackb/rules_proto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
71 lines (64 loc) · 2.06 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
load("@bazel_gazelle//:def.bzl", "gazelle", "gazelle_binary")
load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier")
load("//rules:proto_gazelle.bzl", "proto_gazelle")
# ----------------------------------------------------
# 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 = ["//example:config.yaml"],
gazelle = ":gazelle-protobuf",
imports = [
"@protobufapis//: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",
srcs = [
"BUILD.bazel",
"WORKSPACE",
"go_deps.bzl",
"//cmd/gazelle: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"],
)