xref: /aosp_15_r20/external/grpc-grpc/src/objective-c/examples/RemoteTestClient/RemoteTest.podspec (revision cc02d7e222339f7a4f6ba5f422e6413f4bd931f2)
1Pod::Spec.new do |s|
2  s.name     = 'RemoteTest'
3  s.version  = '0.0.1'
4  s.license  = 'Apache License, Version 2.0'
5  s.authors  = { 'gRPC contributors' => '[email protected]' }
6  s.homepage = 'https://grpc.io/'
7  s.summary = 'RemoteTest example'
8  s.source = { :git => 'https://github.com/grpc/grpc.git' }
9
10  s.ios.deployment_target = '10.0'
11  s.osx.deployment_target = '10.12'
12  s.tvos.deployment_target = '12.0'
13  s.watchos.deployment_target = '6.0'
14
15  # Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients.
16  s.dependency "!ProtoCompiler-gRPCPlugin"
17
18  repo_root = '../../../..'
19  bazel_exec_root = "#{repo_root}/bazel-bin"
20
21  protoc = "#{bazel_exec_root}/external/com_google_protobuf/protoc"
22  well_known_types_dir = "#{repo_root}/third_party/protobuf/src"
23  plugin = "#{bazel_exec_root}/src/compiler/grpc_objective_c_plugin"
24
25  # Since we switched to importing full path, -I needs to be set to the directory
26  # from which the imported file can be found, which is the grpc's root here
27  s.prepare_command = <<-CMD
28    #{protoc} \
29        --plugin=protoc-gen-grpc=#{plugin} \
30        --objc_out=. \
31        --grpc_out=. \
32        -I #{repo_root} \
33        -I #{well_known_types_dir} \
34        #{repo_root}/src/objective-c/examples/RemoteTestClient/*.proto
35  CMD
36
37  s.subspec 'Messages' do |ms|
38    ms.source_files = 'src/objective-c/examples/RemoteTestClient/*.pbobjc.{h,m}'
39    ms.header_mappings_dir = '.'
40    ms.requires_arc = false
41    ms.dependency 'Protobuf'
42  end
43
44  s.subspec 'Services' do |ss|
45    ss.source_files = 'src/objective-c/examples/RemoteTestClient/*.pbrpc.{h,m}'
46    ss.header_mappings_dir = '.'
47    ss.requires_arc = true
48    ss.dependency 'gRPC-ProtoRPC'
49    ss.dependency "#{s.name}/Messages"
50  end
51
52  s.pod_target_xcconfig = {
53    # This is needed by all pods that depend on Protobuf:
54    'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
55    # This is needed by all pods that depend on gRPC-RxLibrary:
56    'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
57  }
58
59end
60