Jorge Canizales | e487a72 | 2016-04-30 12:05:26 -0700 | [diff] [blame^] | 1 | %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}", |
| 67 | } |
| 68 | |
| 69 | s.ios.deployment_target = '7.1' |
| 70 | s.osx.deployment_target = '10.9' |
| 71 | s.requires_arc = false |
| 72 | |
| 73 | name = 'grpc' |
| 74 | s.module_name = name |
| 75 | s.header_dir = name |
| 76 | |
| 77 | s.source_files = ${(',\n' + 19*' ').join('\'%s\'' % f for f in grpc_files(libs))} |
| 78 | |
| 79 | s.private_header_files = ${(',\n' + 27*' ').join('\'%s\'' % f for f in grpc_private_headers(libs))} |
| 80 | |
| 81 | s.header_mappings_dir = 'include/grpc' |
| 82 | |
| 83 | src_root = '$(PODS_ROOT)/gRPC-Core' |
| 84 | # This isn't officially supported in Cocoapods. We've asked for an alternative: |
| 85 | # https://github.com/CocoaPods/CocoaPods/issues/4386 |
| 86 | public_build_settings = { |
| 87 | 'GRPC_SRC_ROOT' => src_root, |
| 88 | 'HEADER_SEARCH_PATHS' => '"$(inherited)" "$(GRPC_SRC_ROOT)/include"', |
| 89 | } |
| 90 | private_build_settings = public_build_settings.merge({ |
| 91 | 'USE_HEADERMAP' => 'NO', |
| 92 | 'ALWAYS_SEARCH_USER_PATHS' => 'NO', |
| 93 | 'USER_HEADER_SEARCH_PATHS' => '"$(GRPC_SRC_ROOT)"', |
| 94 | }) |
| 95 | s.user_target_xcconfig = public_build_settings |
| 96 | s.pod_target_xcconfig = private_build_settings |
| 97 | |
| 98 | s.libraries = 'z' |
| 99 | s.dependency 'BoringSSL', '~> 3.0' |
| 100 | end |