Imported Upstream version 1.21.0
[platform/upstream/grpc.git] / src / objective-c / tests / RemoteTestClient / RemoteTest.podspec
1 Pod::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' => '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' }
9
10   s.ios.deployment_target = '7.1'
11   s.osx.deployment_target = '10.9'
12
13   # Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients.
14   s.dependency "!ProtoCompiler-gRPCPlugin"
15
16   repo_root = '../../../..'
17   config = ENV['CONFIG'] || 'opt'
18   bin_dir = "#{repo_root}/bins/#{config}"
19
20   protoc = "#{bin_dir}/protobuf/protoc"
21   well_known_types_dir = "#{repo_root}/third_party/protobuf/src"
22   plugin = "#{bin_dir}/grpc_objective_c_plugin"
23
24   s.prepare_command = <<-CMD
25     if [ -f #{protoc} ]; then
26       #{protoc} \
27           --plugin=protoc-gen-grpc=#{plugin} \
28           --objc_out=. \
29           --grpc_out=. \
30           -I . \
31           -I #{well_known_types_dir} \
32           *.proto
33     else
34       # protoc was not found bin_dir, use installed version instead
35       (>&2 echo "\nWARNING: Using installed version of protoc. It might be incompatible with gRPC")
36
37       protoc \
38           --plugin=protoc-gen-grpc=#{plugin} \
39           --objc_out=. \
40           --grpc_out=. \
41           -I . \
42           -I #{well_known_types_dir} \
43           *.proto
44     fi
45   CMD
46
47   s.subspec "Messages" do |ms|
48     ms.source_files = "*.pbobjc.{h,m}"
49     ms.header_mappings_dir = "."
50     ms.requires_arc = false
51     ms.dependency "Protobuf"
52   end
53
54   s.subspec "Services" do |ss|
55     ss.source_files = "*.pbrpc.{h,m}"
56     ss.header_mappings_dir = "."
57     ss.requires_arc = true
58     ss.dependency "gRPC-ProtoRPC"
59     ss.dependency "#{s.name}/Messages"
60   end
61
62   s.pod_target_xcconfig = {
63     # This is needed by all pods that depend on Protobuf:
64     'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1 GPB_GRPC_FORWARD_DECLARE_MESSAGE_PROTO=1',
65     # This is needed by all pods that depend on gRPC-RxLibrary:
66     'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
67   }
68 end