Skip to content

Commit 238d30f

Browse files
committed
go proto: include vtprotobuf generation
See envoyproxy/go-control-plane#824 for more information Signed-off-by: John Howard <[email protected]>
1 parent d7ef6c0 commit 238d30f

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

api/bazel/BUILD

+9
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ go_proto_compiler(
2626
visibility = ["//visibility:public"],
2727
)
2828

29+
go_proto_compiler(
30+
name = "vtprotobuf_plugin_go",
31+
options = ["features=marshal_strict+size"],
32+
plugin = "@com_github_planetscale_vtprotobuf//cmd/protoc-gen-go-vtproto",
33+
suffix = "_vtproto.pb.go",
34+
valid_archive = False,
35+
visibility = ["//visibility:public"],
36+
)
37+
2938
json_data(
3039
name = "repository_locations",
3140
data = load_repository_locations_spec(REPOSITORY_LOCATIONS_SPEC),

api/bazel/api_build_system.bzl

+9-2
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ def api_proto_package(
146146
has_services = has_services,
147147
)
148148

149-
compilers = ["@io_bazel_rules_go//proto:go_proto", "@envoy_api//bazel:pgv_plugin_go"]
149+
compilers = ["@io_bazel_rules_go//proto:go_proto", "@envoy_api//bazel:pgv_plugin_go", "@envoy_api//bazel:vtprotobuf_plugin_go"]
150150
if has_services:
151-
compilers = ["@io_bazel_rules_go//proto:go_grpc", "@envoy_api//bazel:pgv_plugin_go"]
151+
compilers = ["@io_bazel_rules_go//proto:go_grpc", "@envoy_api//bazel:pgv_plugin_go", "@envoy_api//bazel:vtprotobuf_plugin_go"]
152152

153153
deps = (
154154
[_go_proto_mapping(dep) for dep in deps] +
@@ -162,6 +162,13 @@ def api_proto_package(
162162
"@io_bazel_rules_go//proto/wkt:struct_go_proto",
163163
"@io_bazel_rules_go//proto/wkt:timestamp_go_proto",
164164
"@io_bazel_rules_go//proto/wkt:wrappers_go_proto",
165+
"@com_github_planetscale_vtprotobuf//types/known/anypb",
166+
"@com_github_planetscale_vtprotobuf//types/known/durationpb",
167+
"@com_github_planetscale_vtprotobuf//types/known/emptypb",
168+
"@com_github_planetscale_vtprotobuf//types/known/fieldmaskpb",
169+
"@com_github_planetscale_vtprotobuf//types/known/structpb",
170+
"@com_github_planetscale_vtprotobuf//types/known/timestamppb",
171+
"@com_github_planetscale_vtprotobuf//types/known/wrapperspb",
165172
]
166173
)
167174
go_proto_library(

bazel/dependency_imports.bzl

+7
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,13 @@ def envoy_dependency_imports(go_version = GO_VERSION, jq_version = JQ_VERSION, y
146146
# use_category = ["api"],
147147
# source = "https://github.com/bufbuild/protoc-gen-validate/blob/v0.6.1/dependencies.bzl#L23-L28"
148148
)
149+
go_repository(
150+
name = "com_github_planetscale_vtprotobuf",
151+
importpath = "github.com/planetscale/vtprotobuf",
152+
sum = "h1:nve54OLsoKDQhb8ZnnHHUyvAK3vjBiwTEJeC3UsqzJ8=",
153+
version = "v0.5.1-0.20231205081218-d930d8ac92f8",
154+
build_external = "external",
155+
)
149156

150157
protoc_gen_jsonschema_go_dependencies()
151158

0 commit comments

Comments
 (0)