blob: a634d46a4826857c63d7d8998db7802e1889c817 [file] [log] [blame]
Jorge Canizalese487a722016-04-30 12:05:26 -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
8
9 # Copyright 2015, Google Inc.
10 # All rights reserved.
11 #
12 # 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.
37
38 <%!
39 def grpc_files(libs):
40 out = []
41 for lib in libs:
42 if lib.name in ("grpc", "gpr"):
43 out += lib.get('headers', [])
44 out += lib.get('public_headers', [])
45 out += lib.get('src', [])
46 return out;
47
48 def grpc_private_headers(libs):
49 out = []
50 for lib in libs:
51 if lib.name in ("grpc", "gpr"):
52 out += lib.get('headers', [])
53 return out
54 %>
55 Pod::Spec.new do |s|
56 s.name = 'gRPC-Core'
57 version = '0.14.0'
58 s.version = version
59 s.summary = 'Core cross-platform gRPC library, written in C'
60 s.homepage = 'http://www.grpc.io'
61 s.license = 'New BSD'
62 s.authors = { 'The gRPC contributors' => 'grpc-packages@google.com' }
63
64 s.source = {
65 :git => 'https://github.com/grpc/grpc.git',
66 :tag => "release-#{version.gsub(/\./, '_')}-objectivec-#{version}",
Jorge Canizales66c8ddd2016-06-08 17:39:40 -070067 :submodules => true,
Jorge Canizalese487a722016-04-30 12:05:26 -070068 }
69
70 s.ios.deployment_target = '7.1'
71 s.osx.deployment_target = '10.9'
72 s.requires_arc = false
73
74 name = 'grpc'
75 s.module_name = name
76 s.header_dir = name
77
Jorge Canizales547f0652016-05-01 19:52:21 -070078 s.module_map = 'include/grpc/module.modulemap'
79
Jorge Canizalese487a722016-04-30 12:05:26 -070080 s.source_files = ${(',\n' + 19*' ').join('\'%s\'' % f for f in grpc_files(libs))}
81
82 s.private_header_files = ${(',\n' + 27*' ').join('\'%s\'' % f for f in grpc_private_headers(libs))}
83
84 s.header_mappings_dir = 'include/grpc'
85
86 src_root = '$(PODS_ROOT)/gRPC-Core'
87 # This isn't officially supported in Cocoapods. We've asked for an alternative:
88 # https://github.com/CocoaPods/CocoaPods/issues/4386
89 public_build_settings = {
90 'GRPC_SRC_ROOT' => src_root,
91 'HEADER_SEARCH_PATHS' => '"$(inherited)" "$(GRPC_SRC_ROOT)/include"',
92 }
93 private_build_settings = public_build_settings.merge({
94 'USE_HEADERMAP' => 'NO',
95 'ALWAYS_SEARCH_USER_PATHS' => 'NO',
96 'USER_HEADER_SEARCH_PATHS' => '"$(GRPC_SRC_ROOT)"',
97 })
98 s.user_target_xcconfig = public_build_settings
99 s.pod_target_xcconfig = private_build_settings
100
101 s.libraries = 'z'
102 s.dependency 'BoringSSL', '~> 3.0'
103 end