Jorge Canizales | c2d7ecb | 2015-02-27 01:22:41 -0800 | [diff] [blame] | 1 | Pod::Spec.new do |s| |
| 2 | s.name = 'gRPC' |
| 3 | s.version = '0.0.1' |
| 4 | s.summary = 'Generic gRPC client library for iOS' |
| 5 | s.homepage = 'https://www.grpc.io' |
| 6 | s.license = 'New BSD' |
| 7 | s.authors = { 'Jorge Canizales' => 'jcanizales@google.com' } |
| 8 | |
| 9 | # s.source = { :git => 'https://github.com/grpc/grpc.git', :tag => 'release-0_5_0' } |
Jorge Canizales | c2d7ecb | 2015-02-27 01:22:41 -0800 | [diff] [blame] | 10 | |
| 11 | s.platform = :ios |
| 12 | s.ios.deployment_target = '6.0' |
| 13 | s.requires_arc = true |
| 14 | |
Jorge Canizales | 045fabb | 2015-04-21 11:39:37 -0700 | [diff] [blame] | 15 | s.subspec 'RxLibrary' do |rs| |
Jorge Canizales | 8957cae | 2015-04-22 23:40:18 -0700 | [diff] [blame] | 16 | rs.summary = 'Reactive Extensions library for iOS.' |
Jorge Canizales | 045fabb | 2015-04-21 11:39:37 -0700 | [diff] [blame] | 17 | rs.authors = { 'Jorge Canizales' => 'jcanizales@google.com' } |
| 18 | |
Jorge Canizales | 146f177 | 2015-04-27 23:59:22 -0700 | [diff] [blame] | 19 | rs.source_files = 'src/objective-c/RxLibrary/*.{h,m}', |
| 20 | 'src/objective-c/RxLibrary/transformations/*.{h,m}', |
| 21 | 'src/objective-c/RxLibrary/private/*.{h,m}' |
Jorge Canizales | 045fabb | 2015-04-21 11:39:37 -0700 | [diff] [blame] | 22 | rs.private_header_files = 'src/objective-c/RxLibrary/private/*.h' |
| 23 | end |
| 24 | |
Jorge Canizales | c2d7ecb | 2015-02-27 01:22:41 -0800 | [diff] [blame] | 25 | s.subspec 'C-Core' do |cs| |
Jorge Canizales | 8957cae | 2015-04-22 23:40:18 -0700 | [diff] [blame] | 26 | cs.summary = 'Core cross-platform gRPC library, written in C.' |
Jorge Canizales | ba37a3e | 2015-03-23 15:34:58 -0700 | [diff] [blame] | 27 | cs.authors = { 'Craig Tiller' => 'ctiller@google.com', |
| 28 | 'David Klempner' => 'klempner@google.com', |
| 29 | 'Nicolas Noble' => 'nnoble@google.com', |
Jorge Canizales | c2d7ecb | 2015-02-27 01:22:41 -0800 | [diff] [blame] | 30 | 'Vijay Pai' => 'vpai@google.com', |
| 31 | 'Yang Gao' => 'yangg@google.com' } |
| 32 | |
| 33 | cs.source_files = 'src/core/**/*.{h,c}', 'include/grpc/*.h', 'include/grpc/**/*.h' |
| 34 | cs.private_header_files = 'src/core/**/*.h' |
| 35 | cs.header_mappings_dir = '.' |
| 36 | cs.xcconfig = { 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/Headers/Build/gRPC" "$(PODS_ROOT)/Headers/Build/gRPC/include"' } |
| 37 | |
| 38 | cs.requires_arc = false |
| 39 | cs.libraries = 'z' |
| 40 | cs.dependency 'OpenSSL', '~> 1.0.200' |
| 41 | end |
| 42 | |
Jorge Canizales | 146f177 | 2015-04-27 23:59:22 -0700 | [diff] [blame] | 43 | # This is a workaround for Cocoapods Issue #1437. |
| 44 | # It renames time.h and string.h to grpc_time.h and grpc_string.h. |
| 45 | # It needs to be here (top-level) instead of in the C-Core subspec because Cocoapods doesn't run |
| 46 | # prepare_command's of subspecs. |
| 47 | s.prepare_command = <<-CMD |
| 48 | DIR_TIME="grpc/support" |
| 49 | BAD_TIME="$DIR_TIME/time.h" |
| 50 | GOOD_TIME="$DIR_TIME/grpc_time.h" |
| 51 | if [ -f "include/$BAD_TIME" ]; |
| 52 | then |
| 53 | grep -rl "$BAD_TIME" include/grpc src/core | xargs sed -i '' -e s@$BAD_TIME@$GOOD_TIME@g |
| 54 | mv "include/$BAD_TIME" "include/$GOOD_TIME" |
| 55 | fi |
| 56 | |
| 57 | DIR_STRING="src/core/support" |
| 58 | BAD_STRING="$DIR_STRING/string.h" |
| 59 | GOOD_STRING="$DIR_STRING/grpc_string.h" |
| 60 | if [ -f "$BAD_STRING" ]; |
| 61 | then |
| 62 | grep -rl "$BAD_STRING" include/grpc src/core | xargs sed -i '' -e s@$BAD_STRING@$GOOD_STRING@g |
| 63 | mv "$BAD_STRING" "$GOOD_STRING" |
| 64 | fi |
| 65 | CMD |
| 66 | |
Jorge Canizales | 8957cae | 2015-04-22 23:40:18 -0700 | [diff] [blame] | 67 | s.subspec 'GRPCClient' do |gs| |
| 68 | gs.summary = 'Objective-C wrapper around the core gRPC library.' |
| 69 | gs.authors = { 'Jorge Canizales' => 'jcanizales@google.com' } |
Jorge Canizales | c2d7ecb | 2015-02-27 01:22:41 -0800 | [diff] [blame] | 70 | |
Jorge Canizales | 146f177 | 2015-04-27 23:59:22 -0700 | [diff] [blame] | 71 | gs.source_files = 'src/objective-c/GRPCClient/*.{h,m}', |
| 72 | 'src/objective-c/GRPCClient/private/*.{h,m}' |
Jorge Canizales | 8957cae | 2015-04-22 23:40:18 -0700 | [diff] [blame] | 73 | gs.private_header_files = 'src/objective-c/GRPCClient/private/*.h' |
Jorge Canizales | c2d7ecb | 2015-02-27 01:22:41 -0800 | [diff] [blame] | 74 | |
Jorge Canizales | 8957cae | 2015-04-22 23:40:18 -0700 | [diff] [blame] | 75 | gs.dependency 'gRPC/C-Core' |
| 76 | # Is this needed in all dependents? |
| 77 | gs.xcconfig = { 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/Headers/Public/gRPC/include"' } |
| 78 | gs.dependency 'gRPC/RxLibrary' |
Jorge Canizales | ba37a3e | 2015-03-23 15:34:58 -0700 | [diff] [blame] | 79 | |
Jorge Canizales | 8957cae | 2015-04-22 23:40:18 -0700 | [diff] [blame] | 80 | # Certificates, to be able to establish TLS connections: |
| 81 | gs.resource_bundles = { 'gRPC' => ['etc/roots.pem'] } |
| 82 | end |
| 83 | |
| 84 | s.subspec 'ProtoRPC' do |ps| |
| 85 | ps.summary = 'RPC library for ProtocolBuffers, based on gRPC' |
| 86 | ps.authors = { 'Jorge Canizales' => 'jcanizales@google.com' } |
| 87 | |
| 88 | ps.source_files = 'src/objective-c/ProtoRPC/*.{h,m}' |
| 89 | |
| 90 | ps.dependency 'gRPC/GRPCClient' |
| 91 | ps.dependency 'gRPC/RxLibrary' |
| 92 | end |
Jorge Canizales | c2d7ecb | 2015-02-27 01:22:41 -0800 | [diff] [blame] | 93 | end |