1load( 2 "//bazel:upb_proto_library.bzl", 3 "upb_c_proto_library", 4 "upb_proto_reflection_library", 5) 6 7package(default_applicable_licenses = ["//:license"]) 8 9licenses(["notice"]) 10 11# Def to Proto 12 13cc_library( 14 name = "def_to_proto", 15 srcs = ["def_to_proto.c"], 16 hdrs = ["def_to_proto.h"], 17 visibility = ["//visibility:public"], 18 deps = [ 19 "//src/google/protobuf:descriptor_upb_c_proto", 20 "//upb:base", 21 "//upb:port", 22 "//upb:reflection", 23 "//upb/reflection:internal", 24 ], 25) 26 27proto_library( 28 name = "def_to_proto_test_proto", 29 srcs = [ 30 "def_to_proto_public_import_test.proto", 31 "def_to_proto_regular_import_test.proto", 32 "def_to_proto_test.proto", 33 ], 34) 35 36upb_c_proto_library( 37 name = "def_to_proto_test_upb_proto", 38 deps = ["def_to_proto_test_proto"], 39) 40 41upb_proto_reflection_library( 42 name = "def_to_proto_test_upb_proto_reflection", 43 deps = ["def_to_proto_test_proto"], 44) 45 46cc_library( 47 name = "def_to_proto_test_lib", 48 testonly = 1, 49 hdrs = ["def_to_proto_test.h"], 50 deps = [ 51 ":def_to_proto", 52 "//:protobuf", 53 "//src/google/protobuf:descriptor_upb_c_proto", 54 "//src/google/protobuf/util:differencer", 55 "//upb:base", 56 "//upb:mem", 57 "//upb/reflection:internal", 58 "@com_google_googletest//:gtest", 59 ], 60) 61 62cc_test( 63 name = "def_to_proto_test", 64 srcs = ["def_to_proto_test.cc"], 65 deps = [ 66 ":def_to_proto", 67 ":def_to_proto_editions_test_upb_proto", 68 ":def_to_proto_editions_test_upb_proto_reflection", 69 ":def_to_proto_test_lib", 70 ":def_to_proto_test_upb_proto", 71 ":def_to_proto_test_upb_proto_reflection", 72 "//:protobuf", 73 "//src/google/protobuf:descriptor_upb_c_proto", 74 "//src/google/protobuf:descriptor_upb_reflection_proto", 75 "//src/google/protobuf/util:differencer", 76 "//upb:base", 77 "//upb:mem", 78 "//upb:reflection", 79 "//upb/test:parse_text_proto", 80 "@com_google_absl//absl/strings", 81 "@com_google_googletest//:gtest", 82 "@com_google_googletest//:gtest_main", 83 ], 84) 85 86# Required fields 87 88cc_library( 89 name = "required_fields", 90 srcs = ["required_fields.c"], 91 hdrs = ["required_fields.h"], 92 visibility = ["//visibility:public"], 93 deps = [ 94 "//upb:base", 95 "//upb:mem", 96 "//upb:message", 97 "//upb:port", 98 "//upb:reflection", 99 ], 100) 101 102proto_library( 103 name = "def_to_proto_editions_test_proto", 104 srcs = ["def_to_proto_editions_test.proto"], 105) 106 107upb_c_proto_library( 108 name = "def_to_proto_editions_test_upb_proto", 109 deps = ["def_to_proto_editions_test_proto"], 110) 111 112upb_proto_reflection_library( 113 name = "def_to_proto_editions_test_upb_proto_reflection", 114 deps = ["def_to_proto_editions_test_proto"], 115) 116 117proto_library( 118 name = "required_fields_test_proto", 119 srcs = [ 120 "required_fields_editions_test.proto", 121 "required_fields_test.proto", 122 ], 123) 124 125upb_c_proto_library( 126 name = "required_fields_test_upb_proto", 127 deps = ["required_fields_test_proto"], 128) 129 130upb_proto_reflection_library( 131 name = "required_fields_test_upb_proto_reflection", 132 deps = ["required_fields_test_proto"], 133) 134 135cc_test( 136 name = "required_fields_test", 137 srcs = ["required_fields_test.cc"], 138 deps = [ 139 ":required_fields", 140 ":required_fields_test_upb_proto", 141 ":required_fields_test_upb_proto_reflection", 142 "//upb:base", 143 "//upb:json", 144 "//upb:mem", 145 "//upb:reflection", 146 "//upb/reflection:internal", 147 "@com_google_absl//absl/strings", 148 "@com_google_googletest//:gtest", 149 "@com_google_googletest//:gtest_main", 150 ], 151) 152 153filegroup( 154 name = "source_files", 155 srcs = [ 156 "def_to_proto.c", 157 "def_to_proto.h", 158 "required_fields.c", 159 "required_fields.h", 160 ], 161 visibility = ["//python/dist:__pkg__"], 162) 163 164filegroup( 165 name = "test_srcs", 166 srcs = glob( 167 [ 168 "**/*test.cc", 169 ], 170 exclude = ["def_to_proto_fuzz_test.cc"], 171 ), 172 visibility = ["//upb:__pkg__"], 173) 174 175filegroup( 176 name = "test_util", 177 srcs = glob( 178 [ 179 "**/*test.h", 180 ], 181 ), 182 visibility = ["//upb:__pkg__"], 183) 184 185filegroup( 186 name = "test_protos", 187 srcs = glob( 188 [ 189 "**/*test.proto", 190 ], 191 ), 192 visibility = ["//upb:__pkg__"], 193) 194