aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--BUILD27
-rw-r--r--gRPC.podspec61
-rw-r--r--src/compiler/objective_c_plugin.cc12
-rw-r--r--src/objective-c/GRPCClient/GRPCCall.h2
-rw-r--r--src/objective-c/GRPCClient/GRPCCall.m2
-rw-r--r--src/objective-c/GRPCClient/private/GRPCDelegateWrapper.m2
-rw-r--r--src/objective-c/GRPCClient/private/GRPCMethodName+HTTP2Encoding.h2
-rw-r--r--src/objective-c/GRPCClient/private/NSError+GRPC.m2
-rw-r--r--src/objective-c/ProtoRPC/ProtoRPC.h2
-rw-r--r--src/objective-c/ProtoRPC/ProtoRPC.m6
-rw-r--r--src/objective-c/ProtoRPC/ProtoService.m6
-rw-r--r--src/objective-c/RxLibrary/transformations/GRXMappingWriter.h2
-rw-r--r--src/objective-c/examples/Sample/Sample/ViewController.m8
-rw-r--r--src/objective-c/tests/GRPCClientTests.m8
-rw-r--r--src/objective-c/tests/InteropTests.m6
-rw-r--r--src/objective-c/tests/LocalClearTextTests.m8
-rw-r--r--src/objective-c/tests/RxLibraryUnitTests.m6
-rw-r--r--templates/BUILD.template27
-rw-r--r--templates/gRPC.podspec.template63
19 files changed, 156 insertions, 96 deletions
diff --git a/BUILD b/BUILD
index d7f0e5a588..ff07cd1132 100644
--- a/BUILD
+++ b/BUILD
@@ -853,3 +853,30 @@ cc_binary(
+
+objc_path = "src/objective-c"
+
+rx_library_path = objc_path + "/RxLibrary"
+
+objc_library(
+ name = "rx_library",
+ hdrs = glob([
+ rx_library_path + "/*.h",
+ rx_library_path + "/transformations/*.h",
+ ]),
+ srcs = glob([
+ rx_library_path + "/*.m",
+ rx_library_path + "/transformations/*.m",
+ ]),
+ includes = [objc_path],
+ deps = [
+ ":rx_library_private",
+ ],
+)
+
+objc_library(
+ name = "rx_library_private",
+ hdrs = glob([rx_library_path + "/private/*.h"]),
+ srcs = glob([rx_library_path + "/private/*.m"]),
+ visibility = ["//visibility:private"],
+)
diff --git a/gRPC.podspec b/gRPC.podspec
index cfbac2f62f..e2a2fbba27 100644
--- a/gRPC.podspec
+++ b/gRPC.podspec
@@ -34,7 +34,6 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
Pod::Spec.new do |s|
s.name = 'gRPC'
s.version = '0.6.0'
@@ -50,17 +49,19 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.8'
s.requires_arc = true
+ objc_dir = 'src/objective-c'
+
# Reactive Extensions library for iOS.
- s.subspec 'RxLibrary' do |rs|
- rs.source_files = 'src/objective-c/RxLibrary/*.{h,m}',
- 'src/objective-c/RxLibrary/transformations/*.{h,m}',
- 'src/objective-c/RxLibrary/private/*.{h,m}'
- rs.private_header_files = 'src/objective-c/RxLibrary/private/*.h'
+ s.subspec 'RxLibrary' do |ss|
+ src_dir = "#{objc_dir}/RxLibrary"
+ ss.source_files = "#{src_dir}/*.{h,m}", "#{src_dir}/**/*.{h,m}"
+ ss.private_header_files = "#{src_dir}/private/*.h"
+ ss.header_mappings_dir = "#{objc_dir}"
end
# Core cross-platform gRPC library, written in C.
- s.subspec 'C-Core' do |cs|
- cs.source_files = 'src/core/support/env.h',
+ s.subspec 'C-Core' do |ss|
+ ss.source_files = 'src/core/support/env.h',
'src/core/support/file.h',
'src/core/support/murmur_hash.h',
'src/core/support/grpc_string.h',
@@ -357,7 +358,7 @@ Pod::Spec.new do |s|
'src/core/census/context.c',
'src/core/census/initialize.c'
- cs.private_header_files = 'src/core/support/env.h',
+ ss.private_header_files = 'src/core/support/env.h',
'src/core/support/file.h',
'src/core/support/murmur_hash.h',
'src/core/support/string.h',
@@ -464,11 +465,11 @@ Pod::Spec.new do |s|
'src/core/transport/transport_impl.h',
'src/core/census/context.h'
- cs.header_mappings_dir = '.'
+ ss.header_mappings_dir = '.'
- cs.requires_arc = false
- cs.libraries = 'z'
- cs.dependency 'OpenSSL', '~> 1.0.200'
+ ss.requires_arc = false
+ ss.libraries = 'z'
+ ss.dependency 'OpenSSL', '~> 1.0.200'
end
# This is a workaround for Cocoapods Issue #1437.
@@ -476,7 +477,7 @@ Pod::Spec.new do |s|
# It needs to be here (top-level) instead of in the C-Core subspec because Cocoapods doesn't run
# prepare_command's of subspecs.
#
- # TODO(jcanizales): Try out Todd Reed's solution at Issue #1437.
+ # TODO(jcanizales): Try out others' solutions at Issue #1437.
s.prepare_command = <<-CMD
# Move contents of include up a level to avoid manually specifying include paths
cp -r "include/grpc" "."
@@ -484,7 +485,7 @@ Pod::Spec.new do |s|
DIR_TIME="grpc/support"
BAD_TIME="$DIR_TIME/time.h"
GOOD_TIME="$DIR_TIME/grpc_time.h"
- grep -rl "$BAD_TIME" grpc src/core | xargs sed -i '' -e s@$BAD_TIME@$GOOD_TIME@g
+ grep -rl "$BAD_TIME" grpc src/core src/objective-c/GRPCClient | xargs sed -i '' -e s@$BAD_TIME@$GOOD_TIME@g
if [ -f "include/$BAD_TIME" ];
then
mv -f "include/$BAD_TIME" "include/$GOOD_TIME"
@@ -493,7 +494,7 @@ Pod::Spec.new do |s|
DIR_STRING="src/core/support"
BAD_STRING="$DIR_STRING/string.h"
GOOD_STRING="$DIR_STRING/grpc_string.h"
- grep -rl "$BAD_STRING" grpc src/core | xargs sed -i '' -e s@$BAD_STRING@$GOOD_STRING@g
+ grep -rl "$BAD_STRING" grpc src/core src/objective-c/GRPCClient | xargs sed -i '' -e s@$BAD_STRING@$GOOD_STRING@g
if [ -f "$BAD_STRING" ];
then
mv -f "$BAD_STRING" "$GOOD_STRING"
@@ -501,25 +502,27 @@ Pod::Spec.new do |s|
CMD
# Objective-C wrapper around the core gRPC library.
- s.subspec 'GRPCClient' do |gs|
- gs.source_files = 'src/objective-c/GRPCClient/*.{h,m}',
- 'src/objective-c/GRPCClient/private/*.{h,m}'
- gs.private_header_files = 'src/objective-c/GRPCClient/private/*.h'
- gs.compiler_flags = '-GCC_WARN_INHIBIT_ALL_WARNINGS', '-w'
+ s.subspec 'GRPCClient' do |ss|
+ src_dir = "#{objc_dir}/GRPCClient"
+ ss.source_files = "#{src_dir}/*.{h,m}", "#{src_dir}/**/*.{h,m}"
+ ss.private_header_files = "#{src_dir}/private/*.h"
+ ss.header_mappings_dir = "#{objc_dir}"
- gs.dependency 'gRPC/C-Core'
- gs.dependency 'gRPC/RxLibrary'
+ ss.dependency 'gRPC/C-Core'
+ ss.dependency 'gRPC/RxLibrary'
# Certificates, to be able to establish TLS connections:
- gs.resource_bundles = { 'gRPC' => ['etc/roots.pem'] }
+ ss.resource_bundles = { 'gRPC' => ['etc/roots.pem'] }
end
# RPC library for ProtocolBuffers, based on gRPC
- s.subspec 'ProtoRPC' do |ps|
- ps.source_files = 'src/objective-c/ProtoRPC/*.{h,m}'
+ s.subspec 'ProtoRPC' do |ss|
+ src_dir = "#{objc_dir}/ProtoRPC"
+ ss.source_files = "#{src_dir}/*.{h,m}"
+ ss.header_mappings_dir = "#{objc_dir}"
- ps.dependency 'gRPC/GRPCClient'
- ps.dependency 'gRPC/RxLibrary'
- ps.dependency 'Protobuf', '~> 3.0.0-alpha-3'
+ ss.dependency 'gRPC/GRPCClient'
+ ss.dependency 'gRPC/RxLibrary'
+ ss.dependency 'Protobuf', '~> 3.0.0-alpha-3'
end
end
diff --git a/src/compiler/objective_c_plugin.cc b/src/compiler/objective_c_plugin.cc
index b5ac2bafa9..2b5ab758fc 100644
--- a/src/compiler/objective_c_plugin.cc
+++ b/src/compiler/objective_c_plugin.cc
@@ -62,8 +62,8 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
{
// Generate .pbrpc.h
- string imports = string("#import \"") + file_name + ".pbobjc.h\"\n"
- "#import <gRPC/ProtoService.h>\n";
+ string imports = string("#import \"") + file_name + ".pbobjc.h\"\n\n"
+ "#import <ProtoRPC/ProtoService.h>\n";
// TODO(jcanizales): Instead forward-declare the input and output types
// and import the files in the .pbrpc.m
@@ -87,10 +87,10 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
{
// Generate .pbrpc.m
- string imports = string("#import \"") + file_name + ".pbrpc.h\"\n"
- "#import <gRPC/GRXWriteable.h>\n"
- "#import <gRPC/GRXWriter+Immediate.h>\n"
- "#import <gRPC/ProtoRPC.h>\n";
+ string imports = string("#import \"") + file_name + ".pbrpc.h\"\n\n"
+ "#import <ProtoRPC/ProtoRPC.h>\n"
+ "#import <RxLibrary/GRXWriteable.h>\n"
+ "#import <RxLibrary/GRXWriter+Immediate.h>\n";
string definitions;
for (int i = 0; i < file->service_count(); i++) {
diff --git a/src/objective-c/GRPCClient/GRPCCall.h b/src/objective-c/GRPCClient/GRPCCall.h
index 7b42498d42..33aae10747 100644
--- a/src/objective-c/GRPCClient/GRPCCall.h
+++ b/src/objective-c/GRPCClient/GRPCCall.h
@@ -46,7 +46,7 @@
// transparently on the same TCP connection.
#import <Foundation/Foundation.h>
-#import <gRPC/GRXWriter.h>
+#import <RxLibrary/GRXWriter.h>
@class GRPCMethodName;
diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m
index a9625a1799..77eebeff76 100644
--- a/src/objective-c/GRPCClient/GRPCCall.m
+++ b/src/objective-c/GRPCClient/GRPCCall.m
@@ -34,7 +34,7 @@
#import "GRPCCall.h"
#include <grpc/grpc.h>
-#include <grpc/support/grpc_time.h>
+#include <grpc/support/time.h>
#import "GRPCMethodName.h"
#import "private/GRPCChannel.h"
diff --git a/src/objective-c/GRPCClient/private/GRPCDelegateWrapper.m b/src/objective-c/GRPCClient/private/GRPCDelegateWrapper.m
index 7d5ecb56d9..59c0565494 100644
--- a/src/objective-c/GRPCClient/private/GRPCDelegateWrapper.m
+++ b/src/objective-c/GRPCClient/private/GRPCDelegateWrapper.m
@@ -33,7 +33,7 @@
#import "GRPCDelegateWrapper.h"
-#import <gRPC/GRXWriteable.h>
+#import <RxLibrary/GRXWriteable.h>
@interface GRPCDelegateWrapper ()
// These are atomic so that cancellation can nillify them from any thread.
diff --git a/src/objective-c/GRPCClient/private/GRPCMethodName+HTTP2Encoding.h b/src/objective-c/GRPCClient/private/GRPCMethodName+HTTP2Encoding.h
index 28c7374517..81c80f2a49 100644
--- a/src/objective-c/GRPCClient/private/GRPCMethodName+HTTP2Encoding.h
+++ b/src/objective-c/GRPCClient/private/GRPCMethodName+HTTP2Encoding.h
@@ -33,7 +33,7 @@
#import <Foundation/Foundation.h>
-#import "GRPCMethodName.h"
+#import "GRPCClient/GRPCMethodName.h"
@interface GRPCMethodName (HTTP2Encoding)
- (NSString *)HTTP2Path;
diff --git a/src/objective-c/GRPCClient/private/NSError+GRPC.m b/src/objective-c/GRPCClient/private/NSError+GRPC.m
index f7390476d9..638f41cb11 100644
--- a/src/objective-c/GRPCClient/private/NSError+GRPC.m
+++ b/src/objective-c/GRPCClient/private/NSError+GRPC.m
@@ -33,7 +33,7 @@
#import "NSError+GRPC.h"
-#include <grpc.h>
+#include <grpc/grpc.h>
NSString * const kGRPCErrorDomain = @"io.grpc";
diff --git a/src/objective-c/ProtoRPC/ProtoRPC.h b/src/objective-c/ProtoRPC/ProtoRPC.h
index b6375f52d6..a383310619 100644
--- a/src/objective-c/ProtoRPC/ProtoRPC.h
+++ b/src/objective-c/ProtoRPC/ProtoRPC.h
@@ -32,7 +32,7 @@
*/
#import <Foundation/Foundation.h>
-#import <gRPC/GRPCCall.h>
+#import <GRPCClient/GRPCCall.h>
@interface ProtoRPC : GRPCCall
diff --git a/src/objective-c/ProtoRPC/ProtoRPC.m b/src/objective-c/ProtoRPC/ProtoRPC.m
index b8f8008422..3912034415 100644
--- a/src/objective-c/ProtoRPC/ProtoRPC.m
+++ b/src/objective-c/ProtoRPC/ProtoRPC.m
@@ -33,10 +33,10 @@
#import "ProtoRPC.h"
-#import <gRPC/GRXWriteable.h>
-#import <gRPC/GRXWriter.h>
-#import <gRPC/GRXWriter+Transformations.h>
#import <Protobuf/GPBProtocolBuffers.h>
+#import <RxLibrary/GRXWriteable.h>
+#import <RxLibrary/GRXWriter.h>
+#import <RxLibrary/GRXWriter+Transformations.h>
@implementation ProtoRPC {
id<GRXWriteable> _responseWriteable;
diff --git a/src/objective-c/ProtoRPC/ProtoService.m b/src/objective-c/ProtoRPC/ProtoService.m
index 453d7b3f1a..47bdb5dc6e 100644
--- a/src/objective-c/ProtoRPC/ProtoService.m
+++ b/src/objective-c/ProtoRPC/ProtoService.m
@@ -33,9 +33,9 @@
#import "ProtoService.h"
-#import <gRPC/GRPCMethodName.h>
-#import <gRPC/GRXWriteable.h>
-#import <gRPC/GRXWriter.h>
+#import <GRPCClient/GRPCMethodName.h>
+#import <RxLibrary/GRXWriteable.h>
+#import <RxLibrary/GRXWriter.h>
#import "ProtoRPC.h"
diff --git a/src/objective-c/RxLibrary/transformations/GRXMappingWriter.h b/src/objective-c/RxLibrary/transformations/GRXMappingWriter.h
index dcebb6132a..55f6f82f20 100644
--- a/src/objective-c/RxLibrary/transformations/GRXMappingWriter.h
+++ b/src/objective-c/RxLibrary/transformations/GRXMappingWriter.h
@@ -31,7 +31,7 @@
*
*/
-#import "GRXWriter.h"
+#import "RxLibrary/GRXWriter.h"
// A "proxy" writer that transforms all the values of its input writer by using a mapping function.
@interface GRXMappingWriter : GRXWriter
diff --git a/src/objective-c/examples/Sample/Sample/ViewController.m b/src/objective-c/examples/Sample/Sample/ViewController.m
index 0011a4508d..05bd6fa2db 100644
--- a/src/objective-c/examples/Sample/Sample/ViewController.m
+++ b/src/objective-c/examples/Sample/Sample/ViewController.m
@@ -33,12 +33,12 @@
#import "ViewController.h"
-#import <gRPC/GRPCCall.h>
-#import <gRPC/GRPCMethodName.h>
-#import <gRPC/GRXWriter+Immediate.h>
-#import <gRPC/GRXWriteable.h>
+#import <GRPCClient/GRPCCall.h>
+#import <GRPCClient/GRPCMethodName.h>
#import <RemoteTest/Messages.pbobjc.h>
#import <RemoteTest/Test.pbrpc.h>
+#import <RxLibrary/GRXWriter+Immediate.h>
+#import <RxLibrary/GRXWriteable.h>
@implementation ViewController
diff --git a/src/objective-c/tests/GRPCClientTests.m b/src/objective-c/tests/GRPCClientTests.m
index 268e67af2f..e421127ea1 100644
--- a/src/objective-c/tests/GRPCClientTests.m
+++ b/src/objective-c/tests/GRPCClientTests.m
@@ -34,11 +34,11 @@
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
-#import <gRPC/GRPCCall.h>
-#import <gRPC/GRPCMethodName.h>
-#import <gRPC/GRXWriter+Immediate.h>
-#import <gRPC/GRXWriteable.h>
+#import <GRPCClient/GRPCCall.h>
+#import <GRPCClient/GRPCMethodName.h>
#import <RemoteTest/Messages.pbobjc.h>
+#import <RxLibrary/GRXWriteable.h>
+#import <RxLibrary/GRXWriter+Immediate.h>
// These are a few tests similar to InteropTests, but which use the generic gRPC client (GRPCCall)
// rather than a generated proto library on top of it.
diff --git a/src/objective-c/tests/InteropTests.m b/src/objective-c/tests/InteropTests.m
index 0a512c17dc..684f7c2ff6 100644
--- a/src/objective-c/tests/InteropTests.m
+++ b/src/objective-c/tests/InteropTests.m
@@ -36,13 +36,13 @@
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
-#import <gRPC/GRXWriter+Immediate.h>
-#import <gRPC/GRXBufferedPipe.h>
-#import <gRPC/ProtoRPC.h>
+#import <ProtoRPC/ProtoRPC.h>
#import <RemoteTest/Empty.pbobjc.h>
#import <RemoteTest/Messages.pbobjc.h>
#import <RemoteTest/Test.pbobjc.h>
#import <RemoteTest/Test.pbrpc.h>
+#import <RxLibrary/GRXBufferedPipe.h>
+#import <RxLibrary/GRXWriter+Immediate.h>
// Convenience constructors for the generated proto messages:
diff --git a/src/objective-c/tests/LocalClearTextTests.m b/src/objective-c/tests/LocalClearTextTests.m
index 68ffd23200..05cc10410a 100644
--- a/src/objective-c/tests/LocalClearTextTests.m
+++ b/src/objective-c/tests/LocalClearTextTests.m
@@ -34,12 +34,12 @@
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
-#import <gRPC/GRPCCall.h>
-#import <gRPC/GRPCMethodName.h>
-#import <gRPC/GRXWriter+Immediate.h>
-#import <gRPC/GRXWriteable.h>
+#import <GRPCClient/GRPCCall.h>
+#import <GRPCClient/GRPCMethodName.h>
#import <RouteGuide/RouteGuide.pbobjc.h>
#import <RouteGuide/RouteGuide.pbrpc.h>
+#import <RxLibrary/GRXWriteable.h>
+#import <RxLibrary/GRXWriter+Immediate.h>
// These tests require a gRPC "RouteGuide" sample server to be running locally. You can compile and
// run one by following the instructions here: https://github.com/grpc/grpc-common/blob/master/cpp/cpptutorial.md#try-it-out
diff --git a/src/objective-c/tests/RxLibraryUnitTests.m b/src/objective-c/tests/RxLibraryUnitTests.m
index 89984d9481..5e3162875a 100644
--- a/src/objective-c/tests/RxLibraryUnitTests.m
+++ b/src/objective-c/tests/RxLibraryUnitTests.m
@@ -34,9 +34,9 @@
#import <UIKit/UIKit.h>
#import <XCTest/XCTest.h>
-#import <gRPC/GRXBufferedPipe.h>
-#import <gRPC/GRXWriter.h>
-#import <gRPC/GRXWriteable.h>
+#import <RxLibrary/GRXBufferedPipe.h>
+#import <RxLibrary/GRXWriteable.h>
+#import <RxLibrary/GRXWriter.h>
// A mock of a GRXSingleValueHandler block that can be queried for how many times it was called and
// what were the last values passed to it.
diff --git a/templates/BUILD.template b/templates/BUILD.template
index ec5fb3584f..63e9f9ebeb 100644
--- a/templates/BUILD.template
+++ b/templates/BUILD.template
@@ -112,3 +112,30 @@ cc_binary(
],
)
</%def>
+
+objc_path = "src/objective-c"
+
+rx_library_path = objc_path + "/RxLibrary"
+
+objc_library(
+ name = "rx_library",
+ hdrs = glob([
+ rx_library_path + "/*.h",
+ rx_library_path + "/transformations/*.h",
+ ]),
+ srcs = glob([
+ rx_library_path + "/*.m",
+ rx_library_path + "/transformations/*.m",
+ ]),
+ includes = [objc_path],
+ deps = [
+ ":rx_library_private",
+ ],
+)
+
+objc_library(
+ name = "rx_library_private",
+ hdrs = glob([rx_library_path + "/private/*.h"]),
+ srcs = glob([rx_library_path + "/private/*.m"]),
+ visibility = ["//visibility:private"],
+)
diff --git a/templates/gRPC.podspec.template b/templates/gRPC.podspec.template
index da5e8880df..02e90d7180 100644
--- a/templates/gRPC.podspec.template
+++ b/templates/gRPC.podspec.template
@@ -59,7 +59,6 @@ def grpc_private_headers(libs):
out.extend(lib.get('headers', []))
return out
%>
-
Pod::Spec.new do |s|
s.name = 'gRPC'
s.version = '0.6.0'
@@ -75,25 +74,27 @@ Pod::Spec.new do |s|
s.osx.deployment_target = '10.8'
s.requires_arc = true
+ objc_dir = 'src/objective-c'
+
# Reactive Extensions library for iOS.
- s.subspec 'RxLibrary' do |rs|
- rs.source_files = 'src/objective-c/RxLibrary/*.{h,m}',
- 'src/objective-c/RxLibrary/transformations/*.{h,m}',
- 'src/objective-c/RxLibrary/private/*.{h,m}'
- rs.private_header_files = 'src/objective-c/RxLibrary/private/*.h'
+ s.subspec 'RxLibrary' do |ss|
+ src_dir = "#{objc_dir}/RxLibrary"
+ ss.source_files = "#{src_dir}/*.{h,m}", "#{src_dir}/**/*.{h,m}"
+ ss.private_header_files = "#{src_dir}/private/*.h"
+ ss.header_mappings_dir = "#{objc_dir}"
end
# Core cross-platform gRPC library, written in C.
- s.subspec 'C-Core' do |cs|
- cs.source_files = ${(',\n' + 22*' ').join('\'%s\'' % f for f in grpc_files(libs))}
+ s.subspec 'C-Core' do |ss|
+ ss.source_files = ${(',\n' + 22*' ').join('\'%s\'' % f for f in grpc_files(libs))}
- cs.private_header_files = ${(',\n' + 30*' ').join('\'%s\'' % f for f in grpc_private_headers(libs))}
+ ss.private_header_files = ${(',\n' + 30*' ').join('\'%s\'' % f for f in grpc_private_headers(libs))}
- cs.header_mappings_dir = '.'
+ ss.header_mappings_dir = '.'
- cs.requires_arc = false
- cs.libraries = 'z'
- cs.dependency 'OpenSSL', '~> 1.0.200'
+ ss.requires_arc = false
+ ss.libraries = 'z'
+ ss.dependency 'OpenSSL', '~> 1.0.200'
end
# This is a workaround for Cocoapods Issue #1437.
@@ -101,7 +102,7 @@ Pod::Spec.new do |s|
# It needs to be here (top-level) instead of in the C-Core subspec because Cocoapods doesn't run
# prepare_command's of subspecs.
#
- # TODO(jcanizales): Try out Todd Reed's solution at Issue #1437.
+ # TODO(jcanizales): Try out others' solutions at Issue #1437.
s.prepare_command = <<-CMD
# Move contents of include up a level to avoid manually specifying include paths
cp -r "include/grpc" "."
@@ -109,7 +110,7 @@ Pod::Spec.new do |s|
DIR_TIME="grpc/support"
BAD_TIME="$DIR_TIME/time.h"
GOOD_TIME="$DIR_TIME/grpc_time.h"
- grep -rl "$BAD_TIME" grpc src/core | xargs sed -i '' -e s@$BAD_TIME@$GOOD_TIME@g
+ grep -rl "$BAD_TIME" grpc src/core src/objective-c/GRPCClient | xargs sed -i '' -e s@$BAD_TIME@$GOOD_TIME@g
if [ -f "include/$BAD_TIME" ];
then
mv -f "include/$BAD_TIME" "include/$GOOD_TIME"
@@ -118,7 +119,7 @@ Pod::Spec.new do |s|
DIR_STRING="src/core/support"
BAD_STRING="$DIR_STRING/string.h"
GOOD_STRING="$DIR_STRING/grpc_string.h"
- grep -rl "$BAD_STRING" grpc src/core | xargs sed -i '' -e s@$BAD_STRING@$GOOD_STRING@g
+ grep -rl "$BAD_STRING" grpc src/core src/objective-c/GRPCClient | xargs sed -i '' -e s@$BAD_STRING@$GOOD_STRING@g
if [ -f "$BAD_STRING" ];
then
mv -f "$BAD_STRING" "$GOOD_STRING"
@@ -126,25 +127,27 @@ Pod::Spec.new do |s|
CMD
# Objective-C wrapper around the core gRPC library.
- s.subspec 'GRPCClient' do |gs|
- gs.source_files = 'src/objective-c/GRPCClient/*.{h,m}',
- 'src/objective-c/GRPCClient/private/*.{h,m}'
- gs.private_header_files = 'src/objective-c/GRPCClient/private/*.h'
- gs.compiler_flags = '-GCC_WARN_INHIBIT_ALL_WARNINGS', '-w'
+ s.subspec 'GRPCClient' do |ss|
+ src_dir = "#{objc_dir}/GRPCClient"
+ ss.source_files = "#{src_dir}/*.{h,m}", "#{src_dir}/**/*.{h,m}"
+ ss.private_header_files = "#{src_dir}/private/*.h"
+ ss.header_mappings_dir = "#{objc_dir}"
- gs.dependency 'gRPC/C-Core'
- gs.dependency 'gRPC/RxLibrary'
+ ss.dependency 'gRPC/C-Core'
+ ss.dependency 'gRPC/RxLibrary'
# Certificates, to be able to establish TLS connections:
- gs.resource_bundles = { 'gRPC' => ['etc/roots.pem'] }
+ ss.resource_bundles = { 'gRPC' => ['etc/roots.pem'] }
end
# RPC library for ProtocolBuffers, based on gRPC
- s.subspec 'ProtoRPC' do |ps|
- ps.source_files = 'src/objective-c/ProtoRPC/*.{h,m}'
-
- ps.dependency 'gRPC/GRPCClient'
- ps.dependency 'gRPC/RxLibrary'
- ps.dependency 'Protobuf', '~> 3.0.0-alpha-3'
+ s.subspec 'ProtoRPC' do |ss|
+ src_dir = "#{objc_dir}/ProtoRPC"
+ ss.source_files = "#{src_dir}/*.{h,m}"
+ ss.header_mappings_dir = "#{objc_dir}"
+
+ ss.dependency 'gRPC/GRPCClient'
+ ss.dependency 'gRPC/RxLibrary'
+ ss.dependency 'Protobuf', '~> 3.0.0-alpha-3'
end
end