BUILD.bazel 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. load("@bazel_skylib//rules:build_test.bzl", "build_test")
  2. load("@rules_pkg//:mappings.bzl", "pkg_filegroup", "pkg_files", "strip_prefix")
  3. load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain")
  4. load("//conformance:defs.bzl", "conformance_test")
  5. load("//java/internal:testing.bzl", "junit_tests")
  6. exports_files(
  7. ["lite.awk"],
  8. visibility = ["//java/core:__pkg__"],
  9. )
  10. exports_files(
  11. ["pom_template.xml"],
  12. visibility = ["//java/core:__pkg__"],
  13. )
  14. alias(
  15. name = "lite",
  16. actual = "//java/core:lite",
  17. visibility = ["//visibility:public"],
  18. )
  19. proto_lang_toolchain(
  20. name = "toolchain",
  21. # keep this in sync w/ LITE_WELL_KNOWN_PROTO_MAP in //:BUILD
  22. blacklisted_protos = [
  23. "//:any_proto",
  24. "//:api_proto",
  25. "//:duration_proto",
  26. "//:empty_proto",
  27. "//:field_mask_proto",
  28. "//:source_context_proto",
  29. "//:struct_proto",
  30. "//:timestamp_proto",
  31. "//:type_proto",
  32. "//:wrappers_proto",
  33. ],
  34. command_line = "--java_out=lite:$(OUT)",
  35. runtime = ":lite",
  36. visibility = ["//visibility:public"],
  37. )
  38. test_suite(
  39. name = "tests",
  40. tests = [
  41. "conformance_test",
  42. "lite_build_test",
  43. "lite_tests",
  44. "//java/core:lite_tests",
  45. ],
  46. )
  47. build_test(
  48. name = "lite_build_test",
  49. targets = [
  50. ":lite",
  51. ],
  52. )
  53. conformance_test(
  54. name = "conformance_test",
  55. failure_list = "//conformance:failure_list_java_lite.txt",
  56. testee = "//conformance:conformance_java_lite",
  57. text_format_failure_list = "//conformance:text_format_failure_list_java_lite.txt",
  58. )
  59. junit_tests(
  60. name = "lite_tests",
  61. size = "small",
  62. srcs = glob(["src/test/**/*.java"]),
  63. deps = [
  64. ":lite",
  65. "//java/core:generic_test_protos_java_proto_lite",
  66. "//java/core:java_test_protos_java_proto_lite",
  67. "//java/core:test_util_lite",
  68. "@maven//:com_google_truth_truth",
  69. "@maven//:junit_junit",
  70. ],
  71. )
  72. pkg_files(
  73. name = "dist_files",
  74. srcs = glob([
  75. "**/*.java",
  76. ]) + [
  77. "BUILD.bazel",
  78. "generate-sources-build.xml",
  79. "generate-test-sources-build.xml",
  80. "lite.awk",
  81. "pom.xml",
  82. "pom_template.xml",
  83. "process-lite-sources-build.xml",
  84. ],
  85. strip_prefix = strip_prefix.from_root(""),
  86. visibility = ["//java:__pkg__"],
  87. )