| 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 |
|
| 9 |
target 'CronetTests' do |
| 10 |
platform :ios, '9.0' |
| 11 |
pod 'Protobuf', :path => "#{GRPC_LOCAL_SRC}/third_party/protobuf", :inhibit_warnings => true |
| 12 |
|
| 13 |
pod '!ProtoCompiler', :path => "#{GRPC_LOCAL_SRC}/src/objective-c" |
| 14 |
pod '!ProtoCompiler-gRPCCppPlugin', :path => "#{GRPC_LOCAL_SRC}/src/objective-c" |
| 15 |
pod 'Protobuf-C++', :podspec => "#{GRPC_LOCAL_SRC}/third_party/protobuf", :inhibit_warnings => true |
| 16 |
|
| 17 |
pod 'BoringSSL-GRPC', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c", :inhibit_warnings => true |
| 18 |
|
| 19 |
pod 'gRPC-Core', :path => GRPC_LOCAL_SRC |
| 20 |
pod 'gRPC-C++/Cronet-Implementation', :path => GRPC_LOCAL_SRC |
| 21 |
pod 'gRPC-C++/Protobuf', :path => GRPC_LOCAL_SRC |
| 22 |
pod 'RemoteTestCpp', :path => "RemoteTestClientCpp", :inhibit_warnings => true |
| 23 |
|
| 24 |
pod 'gRPC-Core/Cronet-Implementation', :path => GRPC_LOCAL_SRC |
| 25 |
pod 'CronetFramework', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c" |
| 26 |
pod 'gRPC-Core/Tests', :path => GRPC_LOCAL_SRC, :inhibit_warnings => true |
| 27 |
end |
| 28 |
|
| 29 |
pre_install do |installer| |
| 30 |
# This is the RemoteTestCpp podspec object. |
| 31 |
remote_test_cpp_spec = installer.pod_targets.find{|t| t.name.start_with?('RemoteTestCpp')}.root_spec |
| 32 |
|
| 33 |
# ios-cpp-test-cronet failes by chance because the RemoteTestCpp target cannot find Protobuf-C++. |
| 34 |
remote_test_cpp_spec.pod_target_xcconfig = { |
| 35 |
'HEADER_SEARCH_PATHS' => '"$(inherited)" "$(PODS_ROOT)/header/Public/Protobuf-C++"', |
| 36 |
} |
| 37 |
end |
| 38 |
|
| 39 |
post_install do |installer| |
| 40 |
installer.pods_project.targets.each do |target| |
| 41 |
target.build_configurations.each do |config| |
| 42 |
config.build_settings['GCC_TREAT_WARNINGS_AS_ERRORS'] = 'YES' |
| 43 |
end |
| 44 |
|
| 45 |
# CocoaPods creates duplicated library targets of gRPC-Core when the test targets include |
| 46 |
# non-default subspecs of gRPC-Core. All of these library targets start with prefix 'gRPC-Core' |
| 47 |
# and require the same error suppresion. |
| 48 |
if target.name.start_with?('gRPC-Core') |
| 49 |
target.build_configurations.each do |config| |
| 50 |
# TODO(zyc): Remove this setting after the issue is resolved |
| 51 |
# GPR_UNREACHABLE_CODE causes "Control may reach end of non-void |
| 52 |
# function" warning |
| 53 |
config.build_settings['GCC_WARN_ABOUT_RETURN_TYPE'] = 'NO' |
| 54 |
# Abseil isn't free from the following warning |
| 55 |
config.build_settings['GCC_WARN_64_TO_32_BIT_CONVERSION'] = 'NO' |
| 56 |
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) COCOAPODS=1 GRPC_CRONET_WITH_PACKET_COALESCING=1' |
| 57 |
end |
| 58 |
end |
| 59 |
|
| 60 |
# Activate Cronet for the dedicated build configuration 'Cronet', which will be used solely by |
| 61 |
# the test target 'InteropTestsRemoteWithCronet' |
| 62 |
# Activate GRPCCall+InternalTests functions for the dedicated build configuration 'Test', which will |
| 63 |
# be used by all test targets using it. |
| 64 |
if /gRPC-(mac|i)OS/.match(target.name) |
| 65 |
target.build_configurations.each do |config| |
| 66 |
if config.name == 'Cronet' |
| 67 |
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) COCOAPODS=1 GRPC_COMPILE_WITH_CRONET=1 GRPC_TEST_OBJC=1' |
| 68 |
elsif config.name == 'Test' |
| 69 |
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) COCOAPODS=1 GRPC_TEST_OBJC=1' |
| 70 |
end |
| 71 |
end |
| 72 |
end |
| 73 |
|
| 74 |
# Enable NSAssert on gRPC |
| 75 |
if /(gRPC|ProtoRPC|RxLibrary)-(mac|i)OS/.match(target.name) |
| 76 |
target.build_configurations.each do |config| |
| 77 |
if config.name != 'Release' |
| 78 |
config.build_settings['ENABLE_NS_ASSERTIONS'] = 'YES' |
| 79 |
end |
| 80 |
end |
| 81 |
end |
| 82 |
end |
| 83 |
end |