upb: clean up upb/json/BUILD

- Match build target names to their corresponding file names (remove stuttering)
- Replace a dep on (deprecated) :upb with a dep on :wire
- Mark :struct_upb_proto as testonly
- Group the cc_test targets together

PiperOrigin-RevId: 541408625
pull/13171/head
Eric Salo 1 year ago committed by Copybara-Service
parent ba500734c3
commit a3f0bce495
  1. 49
      upb/json/BUILD

@ -1,9 +1,6 @@
# TODO(haberman): describe this package.
load(
"//bazel:build_defs.bzl",
"UPB_DEFAULT_COPTS",
)
load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS")
load(
"//bazel:upb_proto_library.bzl",
"upb_proto_library",
@ -27,7 +24,21 @@ cc_library(
"//:lex",
"//:port",
"//:reflection",
"//:wire",
],
)
cc_test(
name = "decode_test",
srcs = ["decode_test.cc"],
deps = [
":json",
":struct_upb_proto",
":test_upb_proto",
":test_upb_proto_reflection",
"//:reflection",
"//:upb",
"@com_google_googletest//:gtest_main",
],
)
@ -36,9 +47,9 @@ cc_test(
srcs = ["encode_test.cc"],
deps = [
":json",
":json_test_upb_proto",
":json_test_upb_proto_reflection",
":struct_upb_proto",
":test_upb_proto",
":test_upb_proto_reflection",
"//:reflection",
"//:upb",
"@com_google_googletest//:gtest_main",
@ -46,39 +57,27 @@ cc_test(
)
proto_library(
name = "json_test_proto",
name = "test_proto",
testonly = 1,
srcs = ["test.proto"],
deps = ["@com_google_protobuf//:struct_proto"],
)
upb_proto_library(
name = "json_test_upb_proto",
name = "test_upb_proto",
testonly = 1,
deps = [":json_test_proto"],
deps = [":test_proto"],
)
upb_proto_reflection_library(
name = "json_test_upb_proto_reflection",
name = "test_upb_proto_reflection",
testonly = 1,
deps = [":json_test_proto"],
)
cc_test(
name = "json_decode_test",
srcs = ["decode_test.cc"],
deps = [
":json",
":json_test_upb_proto",
":json_test_upb_proto_reflection",
":struct_upb_proto",
"//:reflection",
"//:upb",
"@com_google_googletest//:gtest_main",
],
deps = [":test_proto"],
)
# TODO: This target arguably belongs in //google/protobuf/BUILD
upb_proto_library(
name = "struct_upb_proto",
testonly = 1,
deps = ["@com_google_protobuf//:struct_proto"],
)

Loading…
Cancel
Save