| 1 |
source 'https://github.com/CocoaPods/Specs.git' |
| 2 |
|
| 3 |
install! 'cocoapods', :deterministic_uuids => false |
| 4 |
|
| 5 |
# Location of gRPC's repo root relative to this file. |
| 6 |
GRPC_LOCAL_SRC = '../../..' |
| 7 |
|
| 8 |
def grpc_deps |
| 9 |
pod 'Protobuf', :path => "#{GRPC_LOCAL_SRC}/third_party/protobuf", :inhibit_warnings => true |
| 10 |
|
| 11 |
pod '!ProtoCompiler', :path => "#{GRPC_LOCAL_SRC}/src/objective-c" |
| 12 |
pod '!ProtoCompiler-gRPCPlugin', :path => "#{GRPC_LOCAL_SRC}/src/objective-c" |
| 13 |
|
| 14 |
pod 'BoringSSL-GRPC', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c", :inhibit_warnings => true |
| 15 |
|
| 16 |
pod 'gRPC/InternalTesting', :path => GRPC_LOCAL_SRC |
| 17 |
pod 'gRPC-Core', :path => GRPC_LOCAL_SRC, :inhibit_warnings => true |
| 18 |
pod 'gRPC-RxLibrary', :path => GRPC_LOCAL_SRC |
| 19 |
pod 'gRPC-ProtoRPC', :path => GRPC_LOCAL_SRC, :inhibit_warnings => true |
| 20 |
pod 'RemoteTest', :path => "RemoteTestClient", :inhibit_warnings => true |
| 21 |
pod 'Common', :path => "Common" |
| 22 |
end |
| 23 |
|
| 24 |
target 'TvTests' do |
| 25 |
platform :tvos, '10.0' |
| 26 |
grpc_deps |
| 27 |
end |
| 28 |
|
| 29 |
target 'MacTests' do |
| 30 |
platform :osx, '10.13' |
| 31 |
grpc_deps |
| 32 |
end |
| 33 |
|
| 34 |
%w( |
| 35 |
UnitTests |
| 36 |
InteropTests |
| 37 |
).each do |target_name| |
| 38 |
target target_name do |
| 39 |
platform :ios, '9.0' |
| 40 |
grpc_deps |
| 41 |
end |
| 42 |
end |
| 43 |
|
| 44 |
target 'CronetTests' do |
| 45 |
platform :ios, '9.0' |
| 46 |
grpc_deps |
| 47 |
|
| 48 |
pod 'gRPC/GRPCCoreCronet', :path => GRPC_LOCAL_SRC |
| 49 |
pod 'CronetFramework', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c" |
| 50 |
pod 'gRPC-Core/Tests', :path => GRPC_LOCAL_SRC, :inhibit_warnings => true |
| 51 |
end |
| 52 |
|
| 53 |
target 'PerfTests' do |
| 54 |
platform :ios, '9.0' |
| 55 |
grpc_deps |
| 56 |
|
| 57 |
pod 'gRPC/GRPCCoreCronet', :path => GRPC_LOCAL_SRC |
| 58 |
pod 'CronetFramework', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c" |
| 59 |
end |
| 60 |
|
| 61 |
post_install do |installer| |
| 62 |
installer.pods_project.targets.each do |target| |
| 63 |
target.build_configurations.each do |config| |
| 64 |
config.build_settings['GCC_TREAT_WARNINGS_AS_ERRORS'] = 'YES' |
| 65 |
if config.name == 'Test' |
| 66 |
config.build_settings['GCC_OPTIMIZATION_LEVEL'] = '0' |
| 67 |
config.build_settings['SWIFT_OPTIMIZATION_LEVEL'] = '-Onone' |
| 68 |
end |
| 69 |
end |
| 70 |
|
| 71 |
# CocoaPods creates duplicated library targets of gRPC-Core when the test targets include |
| 72 |
# non-default subspecs of gRPC-Core. All of these library targets start with prefix 'gRPC-Core' |
| 73 |
# and require the same error suppresion. |
| 74 |
if target.name.start_with?('gRPC-Core') |
| 75 |
target.build_configurations.each do |config| |
| 76 |
# TODO(zyc): Remove this setting after the issue is resolved |
| 77 |
# GPR_UNREACHABLE_CODE causes "Control may reach end of non-void |
| 78 |
# function" warning |
| 79 |
config.build_settings['GCC_WARN_ABOUT_RETURN_TYPE'] = 'NO' |
| 80 |
# Abseil isn't free from the following warning |
| 81 |
config.build_settings['GCC_WARN_64_TO_32_BIT_CONVERSION'] = 'NO' |
| 82 |
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) COCOAPODS=1 GRPC_CRONET_WITH_PACKET_COALESCING=1 GRPC_CFSTREAM=1' |
| 83 |
end |
| 84 |
end |
| 85 |
|
| 86 |
# Activate Cronet for the dedicated build configuration 'Cronet', which will be used solely by |
| 87 |
# the test target 'InteropTestsRemoteWithCronet' |
| 88 |
# Activate GRPCCall+InternalTests functions for the dedicated build configuration 'Test', which will |
| 89 |
# be used by all test targets using it. |
| 90 |
if /gRPC(-macOS|-iOS|-tvOS|\.|-[0-9a-f])/.match(target.name) |
| 91 |
target.build_configurations.each do |config| |
| 92 |
if config.name == 'Cronet' |
| 93 |
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) COCOAPODS=1 GRPC_COMPILE_WITH_CRONET=1 GRPC_TEST_OBJC=1' |
| 94 |
elsif config.name == 'Test' |
| 95 |
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) COCOAPODS=1 GRPC_TEST_OBJC=1' |
| 96 |
end |
| 97 |
end |
| 98 |
end |
| 99 |
|
| 100 |
# Enable NSAssert on gRPC |
| 101 |
if /(gRPC|ProtoRPC|RxLibrary)/.match(target.name) |
| 102 |
target.build_configurations.each do |config| |
| 103 |
if config.name != 'Release' |
| 104 |
config.build_settings['ENABLE_NS_ASSERTIONS'] = 'YES' |
| 105 |
end |
| 106 |
end |
| 107 |
end |
| 108 |
end |
| 109 |
end |