update BUILD following the new style

pull/19704/head
Muxi Yan 5 years ago
parent f5cd8eb7c8
commit de3131016d
  1. 9
      bazel/grpc_build_system.bzl
  2. 4
      src/compiler/objective_c_plugin.cc
  3. 159
      src/objective-c/BUILD
  4. 2
      src/objective-c/ProtoRPC/ProtoService.m

@ -24,7 +24,6 @@
#
load("//bazel:cc_grpc_library.bzl", "cc_grpc_library")
load("@build_bazel_rules_apple//apple:resources.bzl", "apple_resource_bundle")
load("@upb//bazel:upb_proto_library.bzl", "upb_proto_library")
# The set of pollers to test against if a test exercises polling
@ -199,12 +198,6 @@ def grpc_cc_binary(name, srcs = [], deps = [], external_deps = [], args = [], da
)
def grpc_generate_one_off_targets():
apple_resource_bundle(
# The choice of name is signicant here, since it determines the bundle name.
name = "gRPCCertificates",
resources = ["etc/roots.pem"],
)
# In open-source, grpc_objc* libraries depend directly on //:grpc
native.alias(
name = "grpc_objc",
@ -256,7 +249,7 @@ def grpc_package(name, visibility = "private", features = []):
def grpc_objc_library(
name,
srcs,
srcs = [],
hdrs = [],
textual_hdrs = [],
data = [],

@ -205,10 +205,10 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
::grpc::string imports;
if (framework.empty()) {
imports = LocalImport(file_name + ".pbrpc.h") +
LocalImport(file_name + ".pbobjc.h") +
LocalImport(file_name + ".pbobjc.h");
} else {
imports = FrameworkImport(file_name + ".pbrpc.h", framework) +
FrameworkImport(file_name + ".pbobjc.h", framework) +
FrameworkImport(file_name + ".pbobjc.h", framework);
}
imports += (generator_params.no_v1_compatibility
? SystemImport("ProtoRPC/ProtoRPC.h")

@ -24,18 +24,26 @@ exports_files(["LICENSE"])
grpc_objc_use_cronet_config()
grpc_objc_library(
name = "rx_library_headers",
hdrs = glob([
"RxLibrary/*.h",
"RxLibrary/transformations/*.h",
]),
includes = ["."],
)
grpc_objc_library(
name = "rx_library",
srcs = glob([
"RxLibrary/*.m",
"RxLibrary/transformations/*.m",
]),
hdrs = glob([
"RxLibrary/*.h",
"RxLibrary/transformations/*.h",
]),
includes = ["."],
deps = [":rx_library_private"],
deps = [
":rx_library_private",
":rx_library_headers",
],
)
grpc_objc_library(
@ -50,47 +58,128 @@ grpc_objc_library(
)
grpc_objc_library(
name = "grpc_objc_client",
srcs = glob(
[
"GRPCClient/*.m",
"GRPCClient/private/*.m",
],
exclude = ["GRPCClient/GRPCCall+GID.m"],
),
hdrs = glob(
[
"GRPCClient/*.h",
"GRPCClient/internal/*.h",
],
exclude = ["GRPCClient/GRPCCall+GID.h"],
),
data = ["//:gRPCCertificates"],
name = "grpc_objc_interface_legacy",
hdrs = [
"GRPCClient/GRPCCallLegacy.h",
"GRPCClient/GRPCTypes.h",
],
deps = [
"rx_library_headers",
],
)
grpc_objc_library(
name = "grpc_objc_interface",
hdrs = [
"GRPCClient/GRPCCall.h",
"GRPCClient/GRPCCall+Interceptor.h",
"GRPCClient/GRPCCallOptions.h",
"GRPCClient/GRPCInterceptor.h",
"GRPCClient/GRPCTransport.h",
"GRPCClient/GRPCDispatchable.h",
"GRPCClient/internal/GRPCCallOptions+Internal.h",
],
srcs = [
"GRPCClient/GRPCCall.m",
"GRPCClient/GRPCCall+Interceptor.m",
"GRPCClient/GRPCCallOptions.m",
"GRPCClient/GRPCInterceptor.m",
"GRPCClient/GRPCTransport.m",
"GRPCClient/private/GRPCTransport+Private.m",
],
includes = ["."],
textual_hdrs = glob([
"GRPCClient/private/*.h",
]),
textual_hdrs = [
"GRPCClient/private/GRPCTransport+Private.h",
],
deps = [
":grpc_objc_interface_legacy",
],
)
grpc_objc_library(
name = "grpc_objc_client_core",
hdrs = [
"GRPCClient/GRPCCall+ChannelCredentials.h",
"GRPCClient/GRPCCall+Cronet.h",
"GRPCClient/GRPCCall+OAuth2.h",
"GRPCClient/GRPCCall+Tests.h",
"GRPCClient/GRPCCall+ChannelArg.h",
],
textual_hdrs = native.glob(["GRPCClient/private/GRPCCore/*.h"]),
srcs = [
"GRPCClient/GRPCCall+ChannelArg.m",
"GRPCClient/GRPCCall+ChannelCredentials.m",
"GRPCClient/GRPCCall+Cronet.m",
"GRPCClient/GRPCCall+OAuth2.m",
"GRPCClient/GRPCCall+Tests.m",
"GRPCClient/GRPCCallLegacy.m",
] + native.glob(["GRPCClient/private/GRPCCore/*.m"]),
data = [":gRPCCertificates"],
includes = ["."],
deps = [
":grpc_objc_interface",
":grpc_objc_interface_legacy",
":rx_library",
"//:grpc_objc",
],
)
alias(
name = "grpc_objc_client",
actual = "grpc_objc_client_core",
)
grpc_objc_library(
name = "proto_objc_rpc_legacy_header",
hdrs = [
"ProtoRPC/ProtoRPCLegacy.h",
],
includes = ["."],
)
grpc_objc_library(
name = "proto_objc_rpc_v2",
srcs = [
"ProtoRPC/ProtoMethod.m",
"ProtoRPC/ProtoRPC.m",
"ProtoRPC/ProtoService.m",
],
hdrs = [
"ProtoRPC/ProtoMethod.h",
"ProtoRPC/ProtoRPC.h",
"ProtoRPC/ProtoService.h",
],
includes = ["."],
deps = [
":grpc_objc_interface",
":proto_objc_rpc_legacy_header",
"@com_google_protobuf//:protobuf_objc",
],
)
native.objc_library(
name = "proto_objc_rpc",
srcs = glob(
["ProtoRPC/*.m"],
),
hdrs = glob(
["ProtoRPC/*.h"],
),
# Different from Cocoapods, do not import as if @com_google_protobuf//:protobuf_objc is a framework,
# use the real paths of @com_google_protobuf//:protobuf_objc instead
defines = ["GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=0"],
includes = ["src/objective-c"],
srcs = [
"ProtoRPC/ProtoRPCLegacy.m",
"ProtoRPC/ProtoServiceLegacy.m",
],
hdrs = [
"ProtoRPC/ProtoServiceLegacy.h",
],
deps = [
":grpc_objc_client",
":rx_library",
":proto_objc_rpc_v2",
":proto_objc_rpc_legacy_header",
":grpc_objc_client_core",
"@com_google_protobuf//:protobuf_objc",
],
)
load("@build_bazel_rules_apple//apple:resources.bzl", "apple_resource_bundle")
apple_resource_bundle(
# The choice of name is signicant here, since it determines the bundle name.
name = "gRPCCertificates",
resources = ["etc/roots.pem"],
)

@ -39,7 +39,7 @@
[NSException raise:NSGenericException format:@"Do not call init method of ProtoService"];
return [self initWithHost:nil packageName:nil serviceName:nil callOptions:nil];
}
#pragma clang diasnostic pop
#pragma clang diagnostic pop
// Designated initializer
- (instancetype)initWithHost:(NSString *)host

Loading…
Cancel
Save