Merge pull request #2193 from jcanizales/import-based-on-path

Don't import using directories created by Cocoapods
pull/2149/head
Michael Lumish 10 years ago
commit 85bc52e38a
  1. 61
      gRPC.podspec
  2. 12
      src/compiler/objective_c_plugin.cc
  3. 2
      src/objective-c/GRPCClient/GRPCCall.h
  4. 2
      src/objective-c/GRPCClient/private/GRPCDelegateWrapper.m
  5. 2
      src/objective-c/GRPCClient/private/GRPCMethodName+HTTP2Encoding.h
  6. 2
      src/objective-c/GRPCClient/private/NSError+GRPC.m
  7. 2
      src/objective-c/ProtoRPC/ProtoRPC.h
  8. 6
      src/objective-c/ProtoRPC/ProtoRPC.m
  9. 6
      src/objective-c/ProtoRPC/ProtoService.m
  10. 2
      src/objective-c/RxLibrary/transformations/GRXMappingWriter.h
  11. 8
      src/objective-c/examples/Sample/Sample/ViewController.m
  12. 8
      src/objective-c/tests/GRPCClientTests.m
  13. 6
      src/objective-c/tests/InteropTests.m
  14. 8
      src/objective-c/tests/LocalClearTextTests.m
  15. 6
      src/objective-c/tests/RxLibraryUnitTests.m
  16. 59
      templates/gRPC.podspec.template

File diff suppressed because one or more lines are too long

@ -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++) {

@ -46,7 +46,7 @@
// transparently on the same TCP connection.
#import <Foundation/Foundation.h>
#import <gRPC/GRXWriter.h>
#import <RxLibrary/GRXWriter.h>
@class GRPCMethodName;

@ -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.

@ -33,7 +33,7 @@
#import <Foundation/Foundation.h>
#import "GRPCMethodName.h"
#import "GRPCClient/GRPCMethodName.h"
@interface GRPCMethodName (HTTP2Encoding)
- (NSString *)HTTP2Path;

@ -33,7 +33,7 @@
#import "NSError+GRPC.h"
#include <grpc.h>
#include <grpc/grpc.h>
NSString * const kGRPCErrorDomain = @"io.grpc";

@ -32,7 +32,7 @@
*/
#import <Foundation/Foundation.h>
#import <gRPC/GRPCCall.h>
#import <GRPCClient/GRPCCall.h>
@interface ProtoRPC : GRPCCall

@ -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;

@ -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"

@ -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

@ -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

@ -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.

@ -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:

@ -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

@ -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.

@ -43,7 +43,6 @@ def fix_header_name(name):
split_name = split_name[1:]
return '/'.join(split_name)
%>
Pod::Spec.new do |s|
s.name = 'gRPC'
s.version = '0.6.0'
@ -59,17 +58,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 = \
s.subspec 'C-Core' do |ss|
ss.source_files = \
% for lib in libs:
% if lib.name in ("grpc", "gpr"):
% for hdr in lib.get("headers", []):
@ -84,7 +85,7 @@ Pod::Spec.new do |s|
% endif
% endfor
cs.private_header_files = \
ss.private_header_files = \
% for lib in libs:
% if lib.name in ("grpc", "gpr"):
% for hdr in lib.get("headers", []):
@ -93,11 +94,11 @@ Pod::Spec.new do |s|
% endif
% endfor
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.
@ -105,7 +106,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" "."
@ -130,25 +131,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

Loading…
Cancel
Save