From 45bb7f36b452fa2f7f5eb1f9632476c50c7d4f5e Mon Sep 17 00:00:00 2001 From: Jorge Canizales Date: Mon, 11 Jul 2016 11:09:59 -0700 Subject: Use the deployed protoc spec in samples and README --- examples/objective-c/auth_sample/AuthTestService.podspec | 16 ++++++++++------ examples/objective-c/auth_sample/Podfile | 6 ------ examples/objective-c/helloworld/HelloWorld.podspec | 16 ++++++++++------ examples/objective-c/helloworld/Podfile | 6 ------ examples/objective-c/route_guide/Podfile | 6 ------ examples/objective-c/route_guide/RouteGuide.podspec | 16 ++++++++++------ 6 files changed, 30 insertions(+), 36 deletions(-) (limited to 'examples/objective-c') diff --git a/examples/objective-c/auth_sample/AuthTestService.podspec b/examples/objective-c/auth_sample/AuthTestService.podspec index b47d5bc7f7..d75ee25297 100644 --- a/examples/objective-c/auth_sample/AuthTestService.podspec +++ b/examples/objective-c/auth_sample/AuthTestService.podspec @@ -13,20 +13,20 @@ Pod::Spec.new do |s| # Base directory where the .proto files are. src = "../../protos" - # Directory where the generated files will be placed. - dir = "Pods/" + s.name - # Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients. s.dependency "!ProtoCompiler-gRPCPlugin", "~> 0.14" - repo_root = '../../..' - pods_root = "#{repo_root}/examples/objective-c/auth_sample/Pods" + # Pods directory corresponding to this app's Podfile, relative to the location of this podspec. + pods_root = './Pods' + # Path where Cocoapods downloads protoc and the gRPC plugin. protoc_dir = "#{pods_root}/!ProtoCompiler" protoc = "#{protoc_dir}/protoc" - plugin = "#{pods_root}/!ProtoCompiler-gRPCPlugin/grpc_objective_c_plugin" + # Directory where the generated files will be placed. + dir = "#{pods_root}/#{s.name}" + s.prepare_command = <<-CMD mkdir -p #{dir} #{protoc} \ @@ -38,10 +38,12 @@ Pod::Spec.new do |s| #{src}/auth_sample.proto CMD + # Files generated by protoc s.subspec "Messages" do |ms| ms.source_files = "#{dir}/*.pbobjc.{h,m}", "#{dir}/**/*.pbobjc.{h,m}" ms.header_mappings_dir = dir ms.requires_arc = false + # The generated files depend on the protobuf runtime. ms.dependency "Protobuf" # This is needed by all pods that depend on Protobuf: ms.pod_target_xcconfig = { @@ -49,10 +51,12 @@ Pod::Spec.new do |s| } end + # Files generated by the gRPC plugin s.subspec "Services" do |ss| ss.source_files = "#{dir}/*.pbrpc.{h,m}", "#{dir}/**/*.pbrpc.{h,m}" ss.header_mappings_dir = dir ss.requires_arc = true + # The generated files depend on the gRPC runtime, and on the files generated by protoc. ss.dependency "gRPC-ProtoRPC" ss.dependency "#{s.name}/Messages" end diff --git a/examples/objective-c/auth_sample/Podfile b/examples/objective-c/auth_sample/Podfile index be98cfcbbf..a25d20f477 100644 --- a/examples/objective-c/auth_sample/Podfile +++ b/examples/objective-c/auth_sample/Podfile @@ -3,16 +3,10 @@ platform :ios, '8.0' install! 'cocoapods', :deterministic_uuids => false -# Location of gRPC's repo root relative to this file. -GRPC_LOCAL_SRC = '../../..' - target 'AuthSample' do # Depend on the generated AuthTestService library. pod 'AuthTestService', :path => '.' # Depend on Google's OAuth2 library pod 'Google/SignIn' - - pod '!ProtoCompiler', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c" - pod '!ProtoCompiler-gRPCPlugin', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c" end diff --git a/examples/objective-c/helloworld/HelloWorld.podspec b/examples/objective-c/helloworld/HelloWorld.podspec index aeb2a8a345..11222cb232 100644 --- a/examples/objective-c/helloworld/HelloWorld.podspec +++ b/examples/objective-c/helloworld/HelloWorld.podspec @@ -13,20 +13,20 @@ Pod::Spec.new do |s| # Base directory where the .proto files are. src = "../../protos" - # Directory where the generated files will be placed. - dir = "Pods/" + s.name - # Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients. s.dependency "!ProtoCompiler-gRPCPlugin", "~> 0.14" - repo_root = '../../..' - pods_root = "#{repo_root}/examples/objective-c/helloworld/Pods" + # Pods directory corresponding to this app's Podfile, relative to the location of this podspec. + pods_root = './Pods' + # Path where Cocoapods downloads protoc and the gRPC plugin. protoc_dir = "#{pods_root}/!ProtoCompiler" protoc = "#{protoc_dir}/protoc" - plugin = "#{pods_root}/!ProtoCompiler-gRPCPlugin/grpc_objective_c_plugin" + # Directory where the generated files will be placed. + dir = "#{pods_root}/#{s.name}" + s.prepare_command = <<-CMD mkdir -p #{dir} #{protoc} \ @@ -38,10 +38,12 @@ Pod::Spec.new do |s| #{src}/helloworld.proto CMD + # Files generated by protoc s.subspec "Messages" do |ms| ms.source_files = "#{dir}/*.pbobjc.{h,m}", "#{dir}/**/*.pbobjc.{h,m}" ms.header_mappings_dir = dir ms.requires_arc = false + # The generated files depend on the protobuf runtime. ms.dependency "Protobuf" # This is needed by all pods that depend on Protobuf: ms.pod_target_xcconfig = { @@ -49,10 +51,12 @@ Pod::Spec.new do |s| } end + # Files generated by the gRPC plugin s.subspec "Services" do |ss| ss.source_files = "#{dir}/*.pbrpc.{h,m}", "#{dir}/**/*.pbrpc.{h,m}" ss.header_mappings_dir = dir ss.requires_arc = true + # The generated files depend on the gRPC runtime, and on the files generated by protoc. ss.dependency "gRPC-ProtoRPC" ss.dependency "#{s.name}/Messages" end diff --git a/examples/objective-c/helloworld/Podfile b/examples/objective-c/helloworld/Podfile index 2f9de94df5..0c3feaa47e 100644 --- a/examples/objective-c/helloworld/Podfile +++ b/examples/objective-c/helloworld/Podfile @@ -3,13 +3,7 @@ platform :ios, '8.0' install! 'cocoapods', :deterministic_uuids => false -# Location of gRPC's repo root relative to this file. -GRPC_LOCAL_SRC = '../../..' - target 'HelloWorld' do # Depend on the generated HelloWorld library. pod 'HelloWorld', :path => '.' - - pod '!ProtoCompiler', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c" - pod '!ProtoCompiler-gRPCPlugin', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c" end diff --git a/examples/objective-c/route_guide/Podfile b/examples/objective-c/route_guide/Podfile index 42e6920fa5..b77eb1b11d 100644 --- a/examples/objective-c/route_guide/Podfile +++ b/examples/objective-c/route_guide/Podfile @@ -3,13 +3,7 @@ platform :ios, '8.0' install! 'cocoapods', :deterministic_uuids => false -# Location of gRPC's repo root relative to this file. -GRPC_LOCAL_SRC = '../../..' - target 'RouteGuideClient' do # Depend on the generated RouteGuide library. pod 'RouteGuide', :path => '.' - - pod '!ProtoCompiler', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c" - pod '!ProtoCompiler-gRPCPlugin', :podspec => "#{GRPC_LOCAL_SRC}/src/objective-c" end diff --git a/examples/objective-c/route_guide/RouteGuide.podspec b/examples/objective-c/route_guide/RouteGuide.podspec index f7bb55fe9a..08e4d16cdf 100644 --- a/examples/objective-c/route_guide/RouteGuide.podspec +++ b/examples/objective-c/route_guide/RouteGuide.podspec @@ -13,20 +13,20 @@ Pod::Spec.new do |s| # Base directory where the .proto files are. src = "../../protos" - # Directory where the generated files will be placed. - dir = "Pods/" + s.name - # Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients. s.dependency "!ProtoCompiler-gRPCPlugin", "~> 0.14" - repo_root = '../../..' - pods_root = "#{repo_root}/examples/objective-c/route_guide/Pods" + # Pods directory corresponding to this app's Podfile, relative to the location of this podspec. + pods_root = './Pods' + # Path where Cocoapods downloads protoc and the gRPC plugin. protoc_dir = "#{pods_root}/!ProtoCompiler" protoc = "#{protoc_dir}/protoc" - plugin = "#{pods_root}/!ProtoCompiler-gRPCPlugin/grpc_objective_c_plugin" + # Directory where the generated files will be placed. + dir = "#{pods_root}/#{s.name}" + s.prepare_command = <<-CMD mkdir -p #{dir} #{protoc} \ @@ -38,10 +38,12 @@ Pod::Spec.new do |s| #{src}/route_guide.proto CMD + # Files generated by protoc s.subspec "Messages" do |ms| ms.source_files = "#{dir}/*.pbobjc.{h,m}", "#{dir}/**/*.pbobjc.{h,m}" ms.header_mappings_dir = dir ms.requires_arc = false + # The generated files depend on the protobuf runtime. ms.dependency "Protobuf" # This is needed by all pods that depend on Protobuf: ms.pod_target_xcconfig = { @@ -49,10 +51,12 @@ Pod::Spec.new do |s| } end + # Files generated by the gRPC plugin s.subspec "Services" do |ss| ss.source_files = "#{dir}/*.pbrpc.{h,m}", "#{dir}/**/*.pbrpc.{h,m}" ss.header_mappings_dir = dir ss.requires_arc = true + # The generated files depend on the gRPC runtime, and on the files generated by protoc. ss.dependency "gRPC-ProtoRPC" ss.dependency "#{s.name}/Messages" end -- cgit v1.2.3