gRPC-Core.podspec.template 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. %YAML 1.2
  2. --- |
  3. # GRPC CocoaPods podspec
  4. # This file has been automatically generated from a template file. Please make modifications to
  5. # `templates/gRPC-Core.podspec.template` instead. This file can be regenerated from the template by
  6. # running `tools/buildgen/generate_projects.sh`.
  7. # Copyright 2015, Google Inc.
  8. # All rights reserved.
  9. #
  10. # Redistribution and use in source and binary forms, with or without
  11. # modification, are permitted provided that the following conditions are
  12. # met:
  13. #
  14. # * Redistributions of source code must retain the above copyright
  15. # notice, this list of conditions and the following disclaimer.
  16. # * Redistributions in binary form must reproduce the above
  17. # copyright notice, this list of conditions and the following disclaimer
  18. # in the documentation and/or other materials provided with the
  19. # distribution.
  20. # * Neither the name of Google Inc. nor the names of its
  21. # contributors may be used to endorse or promote products derived from
  22. # this software without specific prior written permission.
  23. #
  24. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  25. # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  26. # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  27. # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  28. # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  29. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  30. # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  31. # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  32. # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  33. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  34. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  35. <%!
  36. def grpc_files(libs):
  37. out = []
  38. for lib in libs:
  39. if lib.name in ("grpc", "gpr"):
  40. out += lib.get('headers', [])
  41. out += lib.get('public_headers', [])
  42. out += lib.get('src', [])
  43. return out;
  44. def grpc_private_headers(libs):
  45. out = []
  46. for lib in libs:
  47. if lib.name in ("grpc", "gpr"):
  48. out += lib.get('headers', [])
  49. return out
  50. %>
  51. Pod::Spec.new do |s|
  52. s.name = 'gRPC-Core'
  53. version = '0.14.0'
  54. s.version = version
  55. s.summary = 'Core cross-platform gRPC library, written in C'
  56. s.homepage = 'http://www.grpc.io'
  57. s.license = 'New BSD'
  58. s.authors = { 'The gRPC contributors' => 'grpc-packages@google.com' }
  59. s.source = {
  60. :git => 'https://github.com/grpc/grpc.git',
  61. :tag => "release-#{version.gsub(/\./, '_')}-objectivec-#{version}",
  62. :submodules => true,
  63. }
  64. s.ios.deployment_target = '7.1'
  65. s.osx.deployment_target = '10.9'
  66. s.requires_arc = false
  67. name = 'grpc'
  68. s.module_name = name
  69. s.header_dir = name
  70. s.header_mappings_dir = 'include/grpc'
  71. src_root = '$(PODS_ROOT)/gRPC-Core'
  72. # This isn't officially supported in Cocoapods. We've asked for an alternative:
  73. # https://github.com/CocoaPods/CocoaPods/issues/4386
  74. #
  75. # The src_root value of $(PODS_ROOT)/gRPC-Core assumes Cocoapods is installing this pod from its
  76. # remote repo. For local development of this library, enabled by using ":path" in the Podfile,
  77. # that assumption is wrong. In such case, the following settings need to be reset with the
  78. # appropriate value of src_root. This can be accomplished in the pre_install hook of the Podfile;
  79. # see src/objective-c/tests/Podfile for an example.
  80. public_build_settings = {
  81. 'GRPC_SRC_ROOT' => src_root,
  82. 'HEADER_SEARCH_PATHS' => '"$(inherited)" "$(GRPC_SRC_ROOT)/include"',
  83. }
  84. private_build_settings = public_build_settings.merge({
  85. 'USE_HEADERMAP' => 'NO',
  86. 'ALWAYS_SEARCH_USER_PATHS' => 'NO',
  87. 'USER_HEADER_SEARCH_PATHS' => '"$(GRPC_SRC_ROOT)"',
  88. })
  89. s.user_target_xcconfig = public_build_settings
  90. s.pod_target_xcconfig = private_build_settings
  91. s.libraries = 'z'
  92. s.dependency 'BoringSSL', '~> 3.0'
  93. # A module map is necessary for a dynamic framework to be correctly created by Cocoapods.
  94. s.module_map = 'include/grpc/module.modulemap'
  95. # List of source files generated by a template: `templates/gRPC-Core.podspec.template`. It can be
  96. # regenerated from the template by running `tools/buildgen/generate_projects.sh`.
  97. # To save you from scrolling, this is the last part of the podspec.
  98. s.source_files = ${(',\n' + 19*' ').join('\'%s\'' % f for f in grpc_files(libs))}
  99. s.private_header_files = ${(',\n' + 27*' ').join('\'%s\'' % f for f in grpc_private_headers(libs))}
  100. end