-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from nareddyt/go_protos
Currently, this repository only generates cc and py protos. This change adds the ability to generate *.pb.go and *.pb.validate.go files for each package. Example: bazel build //udpa/data/orca/v1:pkg_go Note that the option go_package is no longer needed in the proto files (and should not be added!). The go_package will be set automatically to match the path. Example: udpa_service_orca_v1 in the generate proto Please see my comments in this change for more details. Note: This change is largely based on envoyproxy/envoy#8003 Signed-off-by: Teju Nareddy [email protected]
- Loading branch information
Showing
10 changed files
with
143 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
load("@io_bazel_rules_go//proto:compiler.bzl", "go_proto_compiler") | ||
|
||
licenses(["notice"]) # Apache 2 | ||
|
||
go_proto_compiler( | ||
name = "pgv_plugin_go", | ||
options = ["lang=go"], | ||
plugin = "@com_envoyproxy_protoc_gen_validate//:protoc-gen-validate", | ||
suffix = ".pb.validate.go", | ||
valid_archive = False, | ||
visibility = ["//visibility:public"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package go_build_test | ||
|
||
import ( | ||
"testing" | ||
|
||
_ "github.com/cncf/udpa/udpa/data/orca/v1" | ||
_ "github.com/cncf/udpa/udpa/service/orca/v1" | ||
) | ||
|
||
func TestNoop(t *testing.T) { | ||
// Noop test that verifies the successful importation of UDPA protos | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
load("//bazel:api_build_system.bzl", "udpa_proto_library") | ||
load("//bazel:api_build_system.bzl", "udpa_proto_library", "udpa_proto_package") | ||
|
||
licenses(["notice"]) # Apache 2 | ||
|
||
udpa_proto_library( | ||
name = "orca", | ||
srcs = ["orca.proto"], | ||
has_services = 1, | ||
deps = ["//udpa/data/orca/v1:orca_load_report"], | ||
has_services = True, | ||
deps = [ | ||
"//udpa/data/orca/v1:orca_load_report", | ||
], | ||
) | ||
|
||
udpa_proto_package( | ||
has_services = True, | ||
deps = [ | ||
"//udpa/data/orca/v1:pkg", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters