blob: e93eae27ec1f6e3e32a4cff1a0726f67337b310b [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'
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 Canizalesc2d7ecb2015-02-27 01:22:41 -080010
11 s.platform = :ios
12 s.ios.deployment_target = '6.0'
13 s.requires_arc = true
14
Jorge Canizales045fabb2015-04-21 11:39:37 -070015 s.subspec 'RxLibrary' do |rs|
Jorge Canizales8957cae2015-04-22 23:40:18 -070016 rs.summary = 'Reactive Extensions library for iOS.'
Jorge Canizales045fabb2015-04-21 11:39:37 -070017 rs.authors = { 'Jorge Canizales' => 'jcanizales@google.com' }
18
Jorge Canizales146f1772015-04-27 23:59:22 -070019 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 Canizales045fabb2015-04-21 11:39:37 -070022 rs.private_header_files = 'src/objective-c/RxLibrary/private/*.h'
23 end
24
Jorge Canizalesc2d7ecb2015-02-27 01:22:41 -080025 s.subspec 'C-Core' do |cs|
Jorge Canizales8957cae2015-04-22 23:40:18 -070026 cs.summary = 'Core cross-platform gRPC library, written in C.'
Jorge Canizalesba37a3e2015-03-23 15:34:58 -070027 cs.authors = { 'Craig Tiller' => 'ctiller@google.com',
28 'David Klempner' => 'klempner@google.com',
29 'Nicolas Noble' => 'nnoble@google.com',
Jorge Canizalesc2d7ecb2015-02-27 01:22:41 -080030 '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 Canizales146f1772015-04-27 23:59:22 -070043 # 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 Canizales8957cae2015-04-22 23:40:18 -070067 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 Canizalesc2d7ecb2015-02-27 01:22:41 -080070
Jorge Canizales146f1772015-04-27 23:59:22 -070071 gs.source_files = 'src/objective-c/GRPCClient/*.{h,m}',
72 'src/objective-c/GRPCClient/private/*.{h,m}'
Jorge Canizales8957cae2015-04-22 23:40:18 -070073 gs.private_header_files = 'src/objective-c/GRPCClient/private/*.h'
Jorge Canizalesc2d7ecb2015-02-27 01:22:41 -080074
Jorge Canizales8957cae2015-04-22 23:40:18 -070075 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 Canizalesba37a3e2015-03-23 15:34:58 -070079
Jorge Canizales8957cae2015-04-22 23:40:18 -070080 # 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 Canizalesc2d7ecb2015-02-27 01:22:41 -080093end