4 s.license = 'Apache License, Version 2.0'
5 s.authors = { 'gRPC contributors' => 'grpc-io@googlegroups.com' }
6 s.homepage = 'https://grpc.io/'
7 s.summary = 'RemoteTest example'
8 s.source = { :git => 'https://github.com/grpc/grpc.git' }
10 s.ios.deployment_target = '7.1'
11 s.osx.deployment_target = '10.9'
12 s.tvos.deployment_target = '10.0'
13 s.watchos.deployment_target = '4.0'
15 # Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients.
16 s.dependency "!ProtoCompiler-gRPCPlugin"
18 repo_root = '../../../..'
19 bazel_exec_root = "#{repo_root}/bazel-out/darwin-fastbuild/bin"
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"
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 if ENV['FRAMEWORKS'] != 'NO' then
28 s.user_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => 'USE_FRAMEWORKS=1' }
29 s.prepare_command = <<-CMD
30 # Cannot find file if using *.proto. Maybe files' paths must match the -I flags
32 --plugin=protoc-gen-grpc=#{plugin} \
34 --grpc_out=generate_for_named_framework=#{s.name}:. \
35 --objc_opt=generate_for_named_framework=#{s.name} \
37 -I #{well_known_types_dir} \
38 #{repo_root}/src/objective-c/examples/RemoteTestClient/*.proto
41 s.prepare_command = <<-CMD
43 --plugin=protoc-gen-grpc=#{plugin} \
47 -I #{well_known_types_dir} \
48 #{repo_root}/src/objective-c/examples/RemoteTestClient/*.proto
52 s.subspec 'Messages' do |ms|
53 ms.source_files = 'src/objective-c/examples/RemoteTestClient/*.pbobjc.{h,m}'
54 ms.header_mappings_dir = '.'
55 ms.requires_arc = false
56 ms.dependency 'Protobuf'
59 s.subspec 'Services' do |ss|
60 ss.source_files = 'src/objective-c/examples/RemoteTestClient/*.pbrpc.{h,m}'
61 ss.header_mappings_dir = '.'
62 ss.requires_arc = true
63 ss.dependency 'gRPC-ProtoRPC'
64 ss.dependency "#{s.name}/Messages"
67 s.pod_target_xcconfig = {
68 # This is needed by all pods that depend on Protobuf:
69 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
70 # This is needed by all pods that depend on gRPC-RxLibrary:
71 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',