github.com/stackb/rules_proto@v0.0.0-20240221195024-5428336c51f1/pkg/plugin/golang/protobuf/BUILD.bazel (about) 1 load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") 2 3 go_library( 4 name = "protobuf", 5 srcs = ["protoc-gen-go.go"], 6 importpath = "github.com/stackb/rules_proto/pkg/plugin/golang/protobuf", 7 visibility = ["//visibility:public"], 8 deps = [ 9 "//pkg/protoc", 10 "@bazel_gazelle//label:go_default_library", 11 "@bazel_gazelle//rule:go_default_library", 12 ], 13 ) 14 15 go_test( 16 name = "protobuf_test", 17 srcs = ["protoc-gen-go_test.go"], 18 data = [ 19 ":protoc", 20 ":protoc-gen-go", 21 ], 22 deps = [ 23 ":protobuf", 24 "//pkg/plugintest", 25 ], 26 ) 27 28 genrule( 29 name = "protoc_tool", 30 outs = ["protoc"], 31 cmd = "cp $(location @com_google_protobuf//:protoc) $@", 32 executable = True, 33 tools = ["@com_google_protobuf//:protoc"], 34 ) 35 36 genrule( 37 name = "protoc-gen-go_tool", 38 outs = ["protoc-gen-go"], 39 cmd = "cp $(location @org_golang_google_protobuf//cmd/protoc-gen-go) $@", 40 executable = True, 41 tools = ["@org_golang_google_protobuf//cmd/protoc-gen-go"], 42 ) 43 44 filegroup( 45 name = "all_files", 46 testonly = True, 47 srcs = [ 48 "BUILD.bazel", 49 ] + glob(["*.go"]), 50 visibility = ["//pkg:__pkg__"], 51 )