-
Notifications
You must be signed in to change notification settings - Fork 164
/
BUILD.bazel
78 lines (69 loc) · 2.19 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
load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("@io_bazel_rules_go//proto:compiler.bzl", "go_proto_compiler")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
load("@rules_proto//proto:defs.bzl", "proto_library")
# gazelle:prefix github.com/mwitkow/go-proto-validators
# gazelle:build_file_name BUILD.bazel
# By default resolve the top-level package to the gogo variant as it's required for the plugin compilation.
# gazelle:resolve go github.com/mwitkow/go-proto-validators //:validators_gogo
go_proto_compiler(
name = "go_proto_validators",
options = ["gogoimport=false"],
plugin = "//protoc-gen-govalidators",
suffix = ".validator.pb.go",
valid_archive = False,
visibility = ["//visibility:public"],
deps = [
":validators_golang",
],
)
go_proto_compiler(
name = "gogo_proto_validators",
options = ["gogoimport=true"],
plugin = "//protoc-gen-govalidators",
suffix = ".validator.pb.go",
valid_archive = False,
visibility = ["//visibility:public"],
deps = [
":validators_gogo",
],
)
go_proto_library(
name = "_validators_gogo",
compilers = [
"@io_bazel_rules_go//proto:gogo_proto",
],
importpath = "github.com/mwitkow/go-proto-validators",
proto = ":validator_proto",
visibility = ["//:__pkg__"],
)
go_proto_library(
name = "_validators_golang",
compilers = [
"@io_bazel_rules_go//proto:go_proto",
],
importpath = "github.com/mwitkow/go-proto-validators",
proto = ":validator_proto",
visibility = ["//:__pkg__"],
)
go_library(
name = "validators_gogo",
srcs = ["helper.go"],
embed = [":_validators_gogo"],
importpath = "github.com/mwitkow/go-proto-validators",
visibility = ["//visibility:public"],
)
go_library(
name = "validators_golang",
srcs = ["helper.go"],
embed = [":_validators_golang"],
importpath = "github.com/mwitkow/go-proto-validators",
visibility = ["//visibility:public"],
)
proto_library(
name = "validator_proto",
srcs = ["validator.proto"],
import_prefix = "github.com/mwitkow/go-proto-validators",
visibility = ["//visibility:public"],
deps = ["@com_google_protobuf//:descriptor_proto"],
)