blob: a9948a41df4615f8219338bb6241e5d15929ae65 [file] [log] [blame]
Craig Tiller1ebb7c82015-08-31 15:53:36 -07001%YAML 1.2
2--- |
3 # GRPC CocoaPods podspec
4 # This file has been automatically generated from a template file.
5 # Please look at the templates directory instead.
6 # This file can be regenerated from the template by running
7 # tools/buildgen/generate_projects.sh
Jorge Canizalesaff56642015-10-12 19:31:25 -07008
Craig Tiller1ebb7c82015-08-31 15:53:36 -07009 # Copyright 2015, Google Inc.
10 # All rights reserved.
Nicolas "Pixel" Nobleb4f35c02015-06-15 22:32:00 +020011 #
Craig Tiller1ebb7c82015-08-31 15:53:36 -070012 # Redistribution and use in source and binary forms, with or without
13 # modification, are permitted provided that the following conditions are
14 # met:
15 #
16 # * Redistributions of source code must retain the above copyright
17 # notice, this list of conditions and the following disclaimer.
18 # * Redistributions in binary form must reproduce the above
19 # copyright notice, this list of conditions and the following disclaimer
20 # in the documentation and/or other materials provided with the
21 # distribution.
22 # * Neither the name of Google Inc. nor the names of its
23 # contributors may be used to endorse or promote products derived from
24 # this software without specific prior written permission.
25 #
26 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
29 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
30 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
32 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Jorge Canizalesaff56642015-10-12 19:31:25 -070037
Craig Tiller1ebb7c82015-08-31 15:53:36 -070038 <%!
Craig Tiller1ebb7c82015-08-31 15:53:36 -070039 def grpc_files(libs):
40 out = []
41 for lib in libs:
Craig Tillerda179ce2016-02-09 12:01:53 -080042 if lib.name in ("grpc", "gpr"):
Jorge Canizales0c8a3d82015-10-13 13:04:54 -070043 out += lib.get('headers', [])
44 out += lib.get('public_headers', [])
45 out += lib.get('src', [])
Craig Tiller1ebb7c82015-08-31 15:53:36 -070046 return out;
47
48 def grpc_private_headers(libs):
49 out = []
50 for lib in libs:
Craig Tillerda179ce2016-02-09 12:01:53 -080051 if lib.name in ("grpc", "gpr"):
Jorge Canizales0c8a3d82015-10-13 13:04:54 -070052 out += lib.get('headers', [])
Craig Tiller1ebb7c82015-08-31 15:53:36 -070053 return out
54 %>
55 Pod::Spec.new do |s|
56 s.name = 'gRPC'
Jorge Canizales42fe14a2015-12-01 09:34:46 -080057 version = '0.12.0'
Jorge Canizales423f4122015-09-29 14:11:44 -070058 s.version = version
Craig Tiller1ebb7c82015-08-31 15:53:36 -070059 s.summary = 'gRPC client library for iOS/OSX'
60 s.homepage = 'http://www.grpc.io'
61 s.license = 'New BSD'
62 s.authors = { 'The gRPC contributors' => 'grpc-packages@google.com' }
Jorge Canizales423f4122015-09-29 14:11:44 -070063
64 s.source = { :git => 'https://github.com/grpc/grpc.git',
65 :tag => "release-#{version.gsub(/\./, '_')}-objectivec-#{version}" }
66
Craig Tiller1ebb7c82015-08-31 15:53:36 -070067
Craig Tillera32cd492015-09-11 12:28:10 -070068 s.ios.deployment_target = '7.1'
69 s.osx.deployment_target = '10.9'
Craig Tiller1ebb7c82015-08-31 15:53:36 -070070 s.requires_arc = true
71
72 objc_dir = 'src/objective-c'
Jorge Canizalesaff56642015-10-12 19:31:25 -070073
Craig Tiller1ebb7c82015-08-31 15:53:36 -070074 # Reactive Extensions library for iOS.
75 s.subspec 'RxLibrary' do |ss|
76 src_dir = "#{objc_dir}/RxLibrary"
77 ss.source_files = "#{src_dir}/*.{h,m}", "#{src_dir}/**/*.{h,m}"
78 ss.private_header_files = "#{src_dir}/private/*.h"
79 ss.header_mappings_dir = "#{objc_dir}"
80 end
Jorge Canizalesaff56642015-10-12 19:31:25 -070081
Craig Tiller1ebb7c82015-08-31 15:53:36 -070082 # Core cross-platform gRPC library, written in C.
83 s.subspec 'C-Core' do |ss|
84 ss.source_files = ${(',\n' + 22*' ').join('\'%s\'' % f for f in grpc_files(libs))}
Jorge Canizalesaff56642015-10-12 19:31:25 -070085
Craig Tiller1ebb7c82015-08-31 15:53:36 -070086 ss.private_header_files = ${(',\n' + 30*' ').join('\'%s\'' % f for f in grpc_private_headers(libs))}
Jorge Canizalesaff56642015-10-12 19:31:25 -070087
Craig Tiller1ebb7c82015-08-31 15:53:36 -070088 ss.header_mappings_dir = '.'
Jorge Canizales56482bc2015-10-13 19:09:25 -070089 # This isn't officially supported in Cocoapods. We've asked for an alternative:
90 # https://github.com/CocoaPods/CocoaPods/issues/4386
Jorge Canizales10622a82015-10-28 07:10:47 -070091 ss.xcconfig = {
92 'USE_HEADERMAP' => 'NO',
93 'ALWAYS_SEARCH_USER_PATHS' => 'NO',
94 'USER_HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/Headers/Private/gRPC"',
95 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/Headers/Private/gRPC/include"'
96 }
Jorge Canizalesaff56642015-10-12 19:31:25 -070097
Craig Tiller1ebb7c82015-08-31 15:53:36 -070098 ss.requires_arc = false
99 ss.libraries = 'z'
Jorge Canizales38cc4a42016-01-25 15:53:03 -0800100 ss.dependency 'BoringSSL', '~> 2.0'
Jorge Canizalesaff56642015-10-12 19:31:25 -0700101
Craig Tiller1ebb7c82015-08-31 15:53:36 -0700102 # ss.compiler_flags = '-GCC_WARN_INHIBIT_ALL_WARNINGS', '-w'
103 end
Jorge Canizalesaff56642015-10-12 19:31:25 -0700104
Craig Tiller1ebb7c82015-08-31 15:53:36 -0700105 # Objective-C wrapper around the core gRPC library.
106 s.subspec 'GRPCClient' do |ss|
107 src_dir = "#{objc_dir}/GRPCClient"
108 ss.source_files = "#{src_dir}/*.{h,m}", "#{src_dir}/**/*.{h,m}"
109 ss.private_header_files = "#{src_dir}/private/*.h"
110 ss.header_mappings_dir = "#{objc_dir}"
Jorge Canizalesaff56642015-10-12 19:31:25 -0700111
Craig Tiller1ebb7c82015-08-31 15:53:36 -0700112 ss.dependency 'gRPC/C-Core'
113 ss.dependency 'gRPC/RxLibrary'
Jorge Canizalesaff56642015-10-12 19:31:25 -0700114
Craig Tiller1ebb7c82015-08-31 15:53:36 -0700115 # Certificates, to be able to establish TLS connections:
116 ss.resource_bundles = { 'gRPCCertificates' => ['etc/roots.pem'] }
117 end
Jorge Canizalesaff56642015-10-12 19:31:25 -0700118
Craig Tiller1ebb7c82015-08-31 15:53:36 -0700119 # RPC library for ProtocolBuffers, based on gRPC
120 s.subspec 'ProtoRPC' do |ss|
121 src_dir = "#{objc_dir}/ProtoRPC"
122 ss.source_files = "#{src_dir}/*.{h,m}"
123 ss.header_mappings_dir = "#{objc_dir}"
Jorge Canizalesaff56642015-10-12 19:31:25 -0700124
Craig Tiller1ebb7c82015-08-31 15:53:36 -0700125 ss.dependency 'gRPC/GRPCClient'
126 ss.dependency 'gRPC/RxLibrary'
Craig Tillera32cd492015-09-11 12:28:10 -0700127 ss.dependency 'Protobuf', '~> 3.0.0-alpha-4'
Craig Tiller1ebb7c82015-08-31 15:53:36 -0700128 end
Nicolas "Pixel" Nobleb4f35c02015-06-15 22:32:00 +0200129 end