diff --git a/src/objective-c/examples/BUILD b/src/objective-c/examples/BUILD index 4f333cd7502..6689a5a28b8 100644 --- a/src/objective-c/examples/BUILD +++ b/src/objective-c/examples/BUILD @@ -15,20 +15,25 @@ # limitations under the License. -load("//src/objective-c:grpc_objc_internal_library.bzl", "local_objc_grpc_library") +load( + "//src/objective-c:grpc_objc_internal_library.bzl", + "local_objc_grpc_library", + "proto_library_objc_wrapper", +) load("@build_bazel_rules_apple//apple:ios.bzl", "ios_application") load("@build_bazel_rules_apple//apple:tvos.bzl", "tvos_application") load("@build_bazel_rules_apple//apple:watchos.bzl", "watchos_application", "watchos_extension") -proto_library( +proto_library_objc_wrapper( name = "messages_proto", srcs = ["RemoteTestClient/messages.proto"], ) -proto_library( +proto_library_objc_wrapper( name = "test_proto", srcs = ["RemoteTestClient/test.proto"], deps = [":messages_proto"], + use_well_known_protos = True, ) # use objc_grpc_library in bazel:objc_grpc_library.bzl when developing outside the repo diff --git a/src/objective-c/grpc_objc_internal_library.bzl b/src/objective-c/grpc_objc_internal_library.bzl index 51206c1e903..7035e963b94 100644 --- a/src/objective-c/grpc_objc_internal_library.bzl +++ b/src/objective-c/grpc_objc_internal_library.bzl @@ -30,7 +30,20 @@ load( "generate_objc_srcs", "generate_objc_non_arc_srcs" ) -load("//bazel:protobuf.bzl", "well_known_proto_libs") + +def proto_library_objc_wrapper( + name, + srcs, + deps = [], + use_well_known_protos = False): + """proto_library for adding dependencies to google/protobuf protos + use_well_known_protos - ignored in open source version + """ + native.proto_library( + name = name, + srcs = srcs, + deps = deps, + ) def grpc_objc_testing_library( name, @@ -53,7 +66,7 @@ def grpc_objc_testing_library( includes: added to search path, always [the path to objc directory] deps: dependencies """ - + additional_deps = [ ":RemoteTest", "//src/objective-c:grpc_objc_client_internal_testing", @@ -61,7 +74,7 @@ def grpc_objc_testing_library( if not name == "TestConfigs": additional_deps += [":TestConfigs"] - + native.objc_library( name = name, hdrs = hdrs, diff --git a/src/objective-c/tests/BUILD b/src/objective-c/tests/BUILD index 80c12fba548..2d0a57ac21d 100644 --- a/src/objective-c/tests/BUILD +++ b/src/objective-c/tests/BUILD @@ -21,7 +21,8 @@ package(default_visibility = ["//visibility:private"]) load( "//src/objective-c:grpc_objc_internal_library.bzl", "grpc_objc_testing_library", - "local_objc_grpc_library" + "local_objc_grpc_library", + "proto_library_objc_wrapper", ) load("@build_bazel_rules_apple//apple:resources.bzl", "apple_resource_bundle") load("@build_bazel_rules_apple//apple:ios.bzl", "ios_application", "ios_unit_test") @@ -30,15 +31,16 @@ load("@build_bazel_rules_apple//apple:tvos.bzl", "tvos_application", "tvos_unit_ exports_files(["LICENSE"]) -proto_library( +proto_library_objc_wrapper( name = "messages_proto", srcs = ["RemoteTestClient/messages.proto"], ) -proto_library( +proto_library_objc_wrapper( name = "test_proto", srcs = ["RemoteTestClient/test.proto"], deps = [":messages_proto"], + use_well_known_protos = True, ) local_objc_grpc_library(