BUILD.bazel 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. ################################################################################
  2. # Protocol Buffers: C++ Runtime
  3. ################################################################################
  4. # Most rules are under google/protobuf. This package exists for convenience.
  5. load("@rules_pkg//:mappings.bzl", "pkg_filegroup", "pkg_files", "strip_prefix")
  6. load("@upb//cmake:build_defs.bzl", "staleness_test")
  7. load("//conformance:defs.bzl", "conformance_test")
  8. pkg_files(
  9. name = "dist_files",
  10. srcs = glob(["**"]),
  11. strip_prefix = strip_prefix.from_root(""),
  12. visibility = ["//src:__pkg__"],
  13. )
  14. pkg_filegroup(
  15. name = "all_dist_files",
  16. srcs = [
  17. ":dist_files",
  18. "//src/google/protobuf:dist_files",
  19. "//src/google/protobuf/compiler:dist_files",
  20. "//src/google/protobuf/compiler/cpp:dist_files",
  21. "//src/google/protobuf/compiler/csharp:dist_files",
  22. "//src/google/protobuf/compiler/java:dist_files",
  23. "//src/google/protobuf/compiler/objectivec:dist_files",
  24. "//src/google/protobuf/compiler/php:dist_files",
  25. "//src/google/protobuf/compiler/python:dist_files",
  26. "//src/google/protobuf/compiler/ruby:dist_files",
  27. "//src/google/protobuf/io:dist_files",
  28. "//src/google/protobuf/stubs:dist_files",
  29. "//src/google/protobuf/testing:dist_files",
  30. "//src/google/protobuf/util:dist_files",
  31. ],
  32. visibility = ["//pkg:__pkg__"],
  33. )
  34. conformance_test(
  35. name = "conformance_test",
  36. failure_list = "//conformance:failure_list_cpp.txt",
  37. testee = "//conformance:conformance_cpp",
  38. text_format_failure_list = "//conformance:text_format_failure_list_cpp.txt",
  39. )
  40. # Copy the generated file_lists.cmake into a place where the staleness test
  41. # below can use it.
  42. genrule(
  43. name = "copy_cmake_lists",
  44. srcs = ["//pkg:gen_src_file_lists"],
  45. outs = ["cmake_copy/file_lists.cmake"],
  46. cmd = "cp $< $@",
  47. visibility = ["//visibility:private"],
  48. tags = ["manual"],
  49. )
  50. staleness_test(
  51. name = "cmake_lists_staleness_test",
  52. outs = ["file_lists.cmake"],
  53. generated_pattern = "cmake_copy/%s",
  54. # Only run this test if it is explicitly specified on the command line (not
  55. # via //src:all or ...). This file will be automatically updated in a
  56. # GitHub action, so developers should not worry about failures from this
  57. # test.
  58. tags = ["manual"],
  59. )