BUILD.bazel 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # Copyright 2020 The gRPC authors.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. load("//bazel:python_rules.bzl", "py_proto_library")
  15. package(default_testonly = 1)
  16. proto_library(
  17. name = "simplest_proto",
  18. testonly = True,
  19. srcs = ["simplest.proto"],
  20. strip_import_prefix = "/tools/distrib/python/grpcio_tools/grpc_tools/test/",
  21. )
  22. proto_library(
  23. name = "complicated_proto",
  24. testonly = True,
  25. srcs = ["complicated.proto"],
  26. strip_import_prefix = "/tools/distrib/python/grpcio_tools/grpc_tools/test/",
  27. deps = [":simplest_proto"],
  28. )
  29. py_proto_library(
  30. name = "complicated_py_pb2",
  31. testonly = True,
  32. deps = ["complicated_proto"],
  33. )
  34. py_test(
  35. name = "protoc_test",
  36. srcs = ["protoc_test.py"],
  37. data = [
  38. "complicated.proto",
  39. "flawed.proto",
  40. "simple.proto",
  41. "simpler.proto",
  42. "simplest.proto",
  43. ],
  44. python_version = "PY3",
  45. deps = [
  46. ":complicated_py_pb2",
  47. "//tools/distrib/python/grpcio_tools:grpc_tools",
  48. ],
  49. )