BUILD 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. load(
  2. "@io_bazel_rules_go//proto:def.bzl",
  3. "go_proto_library",
  4. )
  5. package(default_visibility = ["//visibility:public"])
  6. load(
  7. "@io_bazel_rules_go//go:def.bzl",
  8. "go_library",
  9. "go_test",
  10. )
  11. proto_library(
  12. name = "v1_proto",
  13. srcs = ["api.proto"],
  14. tags = ["automanaged"],
  15. deps = ["@gogo_special_proto//github.com/gogo/protobuf/gogoproto"],
  16. )
  17. go_proto_library(
  18. name = "v1_go_proto",
  19. compilers = ["@io_bazel_rules_go//proto:gogofast_grpc"],
  20. importpath = "go-common/app/service/main/share/api",
  21. proto = ":v1_proto",
  22. tags = ["automanaged"],
  23. deps = ["@com_github_gogo_protobuf//gogoproto:go_default_library"],
  24. )
  25. go_library(
  26. name = "go_default_library",
  27. srcs = ["client.go"],
  28. embed = [":v1_go_proto"],
  29. importpath = "go-common/app/service/main/share/api",
  30. tags = ["automanaged"],
  31. visibility = ["//visibility:public"],
  32. deps = [
  33. "//library/net/rpc/warden:go_default_library",
  34. "@com_github_gogo_protobuf//gogoproto:go_default_library",
  35. "@com_github_gogo_protobuf//proto:go_default_library",
  36. "@org_golang_google_grpc//:go_default_library",
  37. "@org_golang_x_net//context:go_default_library",
  38. ],
  39. )
  40. filegroup(
  41. name = "package-srcs",
  42. srcs = glob(["**"]),
  43. tags = ["automanaged"],
  44. visibility = ["//visibility:private"],
  45. )
  46. filegroup(
  47. name = "all-srcs",
  48. srcs = [":package-srcs"],
  49. tags = ["automanaged"],
  50. visibility = ["//visibility:public"],
  51. )
  52. go_test(
  53. name = "go_default_test",
  54. srcs = ["client_test.go"],
  55. embed = [":go_default_library"],
  56. rundir = ".",
  57. tags = ["automanaged"],
  58. deps = [
  59. "//library/ecode:go_default_library",
  60. "//vendor/github.com/smartystreets/goconvey/convey:go_default_library",
  61. ],
  62. )