diff options
author | Jorge Canizales <jcanizales@google.com> | 2016-07-11 11:09:59 -0700 |
---|---|---|
committer | Jorge Canizales <jcanizales@google.com> | 2016-07-11 11:09:59 -0700 |
commit | 45bb7f36b452fa2f7f5eb1f9632476c50c7d4f5e (patch) | |
tree | 53c4fe304cb1030e388102b55f2cf4d83bc17190 /examples/objective-c/auth_sample | |
parent | eb3ebc58287391d0a54779cccef8d37058bbc2c6 (diff) |
Use the deployed protoc spec in samples and README
Diffstat (limited to 'examples/objective-c/auth_sample')
-rw-r--r-- | examples/objective-c/auth_sample/AuthTestService.podspec | 16 | ||||
-rw-r--r-- | examples/objective-c/auth_sample/Podfile | 6 |
2 files changed, 10 insertions, 12 deletions
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 |