From 6443601337ef6feb9bf30dd287d79e835e862987 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Thu, 21 Jun 2018 14:39:18 -0700 Subject: [PATCH] Subspec for C++ protobuf --- gRPC-C++.podspec | 13 ++++++++++++- templates/gRPC-C++.podspec.template | 10 +++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index d7afd5a99c4..b7dd97f829f 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -24,7 +24,7 @@ Pod::Spec.new do |s| s.name = 'gRPC-C++' # TODO (mxyan): use version that match gRPC version when pod is stabilized # version = '1.14.0-dev' - version = '0.0.2' + version = '0.0.3' s.version = version s.summary = 'gRPC C++ library' s.homepage = 'https://grpc.io' @@ -664,6 +664,17 @@ Pod::Spec.new do |s| 'src/core/ext/transport/inproc/inproc_transport.h' end + s.subspec 'Protobuf' do |ss| + ss.header_mappings_dir = 'include/grpcpp' + ss.dependency "#{s.name}/Interface", version + + ss.source_files = 'include/grpcpp/impl/codegen/proto_buffer_reader.h', + 'include/grpcpp/impl/codegen/proto_buffer_writer.h', + 'include/grpcpp/impl/codegen/proto_utils.h', + 'include/grpcpp/impl/codegen/config_protobuf.h', + 'include/grpcpp/impl/codegen/config_protobuf.h' + end + s.prepare_command = <<-END_OF_COMMAND find src/cpp/ -type f ! -path '*.grpc_back' -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(pb(_.*)?\\.h)";#include ;g' find src/cpp/ -type f -path '*.grpc_back' -print0 | xargs -0 rm diff --git a/templates/gRPC-C++.podspec.template b/templates/gRPC-C++.podspec.template index 2853bb63ab0..cff252b3a9b 100644 --- a/templates/gRPC-C++.podspec.template +++ b/templates/gRPC-C++.podspec.template @@ -49,6 +49,7 @@ out = grpc_lib_files(filegroups, ("grpc++_codegen_proto", "grpc++_config_proto"), ("headers", "src", "public_headers")) excl_files = grpc_lib_files(filegroups, ("grpc++_codegen_base",), ("headers", "src", "public_headers")) out = [file for file in out if file not in excl_files] + out = filter_grpcpp(out) return out def grpcpp_private_files(libs, filegroups): @@ -131,7 +132,7 @@ s.name = 'gRPC-C++' # TODO (mxyan): use version that match gRPC version when pod is stabilized # version = '${settings.version}' - version = '0.0.2' + version = '0.0.3' s.version = version s.summary = 'gRPC C++ library' s.homepage = 'https://grpc.io' @@ -195,6 +196,13 @@ ss.private_header_files = ${ruby_multiline_list(grpcpp_private_headers(libs, filegroups), 30)} end + s.subspec 'Protobuf' do |ss| + ss.header_mappings_dir = 'include/grpcpp' + ss.dependency "#{s.name}/Interface", version + + ss.source_files = ${ruby_multiline_list(grpcpp_proto_files(filegroups), 22)} + end + s.prepare_command = <<-END_OF_COMMAND find src/cpp/ -type f ! -path '*.grpc_back' -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(pb(_.*)?\\.h)";#include ;g' find src/cpp/ -type f -path '*.grpc_back' -print0 | xargs -0 rm