Podfile 3.6 KB

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