blob: 8429357a9e19b92599e5fd83312b8ff5a16f7daf [file] [log] [blame]
Jorge Canizalesc2d7ecb2015-02-27 01:22:41 -08001Pod::Spec.new do |s|
2 s.name = 'gRPC'
3 s.version = '0.0.1'
Vince Gatto167b9722015-05-12 15:33:49 -07004 s.summary = 'Generic gRPC client library for iOS/OSX'
Jorge Canizalesc2d7ecb2015-02-27 01:22:41 -08005 s.homepage = 'https://www.grpc.io'
6 s.license = 'New BSD'
murgatroid9927c0bf42015-05-04 09:31:12 -07007 s.authors = { 'Jorge Canizales' => 'jcanizales@google.com',
Jorge Canizales44fb2952015-05-16 12:11:35 -07008 'Michael Lumish' => 'mlumish@google.com' }
Jorge Canizalesc2d7ecb2015-02-27 01:22:41 -08009
10 # s.source = { :git => 'https://github.com/grpc/grpc.git', :tag => 'release-0_5_0' }
Jorge Canizalesc2d7ecb2015-02-27 01:22:41 -080011
Jorge Canizalesc2d7ecb2015-02-27 01:22:41 -080012 s.ios.deployment_target = '6.0'
Vince Gatto167b9722015-05-12 15:33:49 -070013 s.osx.deployment_target = '10.8'
Jorge Canizalesc2d7ecb2015-02-27 01:22:41 -080014 s.requires_arc = true
15
Jorge Canizales045fabb2015-04-21 11:39:37 -070016 s.subspec 'RxLibrary' do |rs|
Jorge Canizales8957cae2015-04-22 23:40:18 -070017 rs.summary = 'Reactive Extensions library for iOS.'
Jorge Canizales045fabb2015-04-21 11:39:37 -070018 rs.authors = { 'Jorge Canizales' => 'jcanizales@google.com' }
19
Jorge Canizales146f1772015-04-27 23:59:22 -070020 rs.source_files = 'src/objective-c/RxLibrary/*.{h,m}',
21 'src/objective-c/RxLibrary/transformations/*.{h,m}',
22 'src/objective-c/RxLibrary/private/*.{h,m}'
Jorge Canizales045fabb2015-04-21 11:39:37 -070023 rs.private_header_files = 'src/objective-c/RxLibrary/private/*.h'
24 end
25
Jorge Canizalesc2d7ecb2015-02-27 01:22:41 -080026 s.subspec 'C-Core' do |cs|
Jorge Canizales8957cae2015-04-22 23:40:18 -070027 cs.summary = 'Core cross-platform gRPC library, written in C.'
Jorge Canizalesba37a3e2015-03-23 15:34:58 -070028 cs.authors = { 'Craig Tiller' => 'ctiller@google.com',
29 'David Klempner' => 'klempner@google.com',
30 'Nicolas Noble' => 'nnoble@google.com',
Jorge Canizalesc2d7ecb2015-02-27 01:22:41 -080031 'Vijay Pai' => 'vpai@google.com',
32 'Yang Gao' => 'yangg@google.com' }
33
34 cs.source_files = 'src/core/**/*.{h,c}', 'include/grpc/*.h', 'include/grpc/**/*.h'
35 cs.private_header_files = 'src/core/**/*.h'
36 cs.header_mappings_dir = '.'
37 cs.xcconfig = { 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/Headers/Build/gRPC" "$(PODS_ROOT)/Headers/Build/gRPC/include"' }
38
39 cs.requires_arc = false
40 cs.libraries = 'z'
41 cs.dependency 'OpenSSL', '~> 1.0.200'
42 end
43
Jorge Canizales146f1772015-04-27 23:59:22 -070044 # This is a workaround for Cocoapods Issue #1437.
45 # It renames time.h and string.h to grpc_time.h and grpc_string.h.
46 # It needs to be here (top-level) instead of in the C-Core subspec because Cocoapods doesn't run
47 # prepare_command's of subspecs.
48 s.prepare_command = <<-CMD
49 DIR_TIME="grpc/support"
50 BAD_TIME="$DIR_TIME/time.h"
51 GOOD_TIME="$DIR_TIME/grpc_time.h"
52 if [ -f "include/$BAD_TIME" ];
53 then
54 grep -rl "$BAD_TIME" include/grpc src/core | xargs sed -i '' -e s@$BAD_TIME@$GOOD_TIME@g
55 mv "include/$BAD_TIME" "include/$GOOD_TIME"
56 fi
57
58 DIR_STRING="src/core/support"
59 BAD_STRING="$DIR_STRING/string.h"
60 GOOD_STRING="$DIR_STRING/grpc_string.h"
61 if [ -f "$BAD_STRING" ];
62 then
63 grep -rl "$BAD_STRING" include/grpc src/core | xargs sed -i '' -e s@$BAD_STRING@$GOOD_STRING@g
64 mv "$BAD_STRING" "$GOOD_STRING"
65 fi
66 CMD
67
Jorge Canizales8957cae2015-04-22 23:40:18 -070068 s.subspec 'GRPCClient' do |gs|
69 gs.summary = 'Objective-C wrapper around the core gRPC library.'
Jorge Canizales44fb2952015-05-16 12:11:35 -070070 gs.authors = { 'Jorge Canizales' => 'jcanizales@google.com',
71 'Michael Lumish' => 'mlumish@google.com' }
Jorge Canizalesc2d7ecb2015-02-27 01:22:41 -080072
Jorge Canizales146f1772015-04-27 23:59:22 -070073 gs.source_files = 'src/objective-c/GRPCClient/*.{h,m}',
74 'src/objective-c/GRPCClient/private/*.{h,m}'
Jorge Canizales8957cae2015-04-22 23:40:18 -070075 gs.private_header_files = 'src/objective-c/GRPCClient/private/*.h'
Jorge Canizalesc2d7ecb2015-02-27 01:22:41 -080076
Jorge Canizales8957cae2015-04-22 23:40:18 -070077 gs.dependency 'gRPC/C-Core'
78 # Is this needed in all dependents?
79 gs.xcconfig = { 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/Headers/Public/gRPC/include"' }
80 gs.dependency 'gRPC/RxLibrary'
Jorge Canizalesba37a3e2015-03-23 15:34:58 -070081
Jorge Canizales8957cae2015-04-22 23:40:18 -070082 # Certificates, to be able to establish TLS connections:
83 gs.resource_bundles = { 'gRPC' => ['etc/roots.pem'] }
84 end
85
86 s.subspec 'ProtoRPC' do |ps|
87 ps.summary = 'RPC library for ProtocolBuffers, based on gRPC'
88 ps.authors = { 'Jorge Canizales' => 'jcanizales@google.com' }
89
90 ps.source_files = 'src/objective-c/ProtoRPC/*.{h,m}'
91
92 ps.dependency 'gRPC/GRPCClient'
93 ps.dependency 'gRPC/RxLibrary'
Jorge Canizales44fb2952015-05-16 12:11:35 -070094 ps.dependency 'Protobuf', '~> 3.0'
Jorge Canizales8957cae2015-04-22 23:40:18 -070095 end
Jorge Canizalesc2d7ecb2015-02-27 01:22:41 -080096end