diff options
Diffstat (limited to 'examples/objective-c')
-rw-r--r-- | examples/objective-c/auth_sample/AuthTestService.podspec | 34 | ||||
-rw-r--r-- | examples/objective-c/auth_sample/Misc/GoogleService-Info.plist | 32 | ||||
-rw-r--r-- | examples/objective-c/auth_sample/Podfile | 4 | ||||
-rw-r--r-- | examples/objective-c/helloworld/HelloWorld.podspec | 34 | ||||
-rw-r--r-- | examples/objective-c/helloworld/Podfile | 4 | ||||
-rw-r--r-- | examples/objective-c/route_guide/Podfile | 5 | ||||
-rw-r--r-- | examples/objective-c/route_guide/RouteGuide.podspec | 34 |
7 files changed, 122 insertions, 25 deletions
diff --git a/examples/objective-c/auth_sample/AuthTestService.podspec b/examples/objective-c/auth_sample/AuthTestService.podspec index d246653ea7..d709c7e636 100644 --- a/examples/objective-c/auth_sample/AuthTestService.podspec +++ b/examples/objective-c/auth_sample/AuthTestService.podspec @@ -13,27 +13,51 @@ Pod::Spec.new do |s| # Base directory where the .proto files are. src = "../../protos" + # Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients. + s.dependency "!ProtoCompiler-gRPCPlugin", "~> 1.0.0-pre1" + + # 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/" + s.name + dir = "#{pods_root}/#{s.name}" - # Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients. s.prepare_command = <<-CMD mkdir -p #{dir} - protoc -I #{src} --objc_out=#{dir} --objcgrpc_out=#{dir} #{src}/auth_sample.proto + #{protoc} \ + --plugin=protoc-gen-grpc=#{plugin} \ + --objc_out=#{dir} \ + --grpc_out=#{dir} \ + -I #{src} \ + -I #{protoc_dir} \ + #{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 - ms.dependency "Protobuf", "~> 3.0.0-alpha-4" + # 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 = { + 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1', + } 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 - ss.dependency "gRPC", "~> 0.12" + # 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 end diff --git a/examples/objective-c/auth_sample/Misc/GoogleService-Info.plist b/examples/objective-c/auth_sample/Misc/GoogleService-Info.plist index 86909d84a3..ff22507423 100644 --- a/examples/objective-c/auth_sample/Misc/GoogleService-Info.plist +++ b/examples/objective-c/auth_sample/Misc/GoogleService-Info.plist @@ -2,9 +2,39 @@ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> + <key>AD_UNIT_ID_FOR_BANNER_TEST</key> + <string>redacted</string> + <key>AD_UNIT_ID_FOR_INTERSTITIAL_TEST</key> + <string>redacted</string> <key>CLIENT_ID</key> <string>15087385131-lh9bpkiai9nls53uadju0if6k7un3uih.apps.googleusercontent.com</string> <key>REVERSED_CLIENT_ID</key> <string>com.googleusercontent.apps.15087385131-lh9bpkiai9nls53uadju0if6k7un3uih</string> + <key>API_KEY</key> + <string>redacted</string> + <key>GCM_SENDER_ID</key> + <string>redacted</string> + <key>PLIST_VERSION</key> + <string>1</string> + <key>BUNDLE_ID</key> + <string>io.grpc.AuthSample</string> + <key>PROJECT_ID</key> + <string>grpc-authsample</string> + <key>STORAGE_BUCKET</key> + <string>grpc-authsample.appspot.com</string> + <key>IS_ADS_ENABLED</key> + <false/> + <key>IS_ANALYTICS_ENABLED</key> + <false/> + <key>IS_APPINVITE_ENABLED</key> + <false/> + <key>IS_GCM_ENABLED</key> + <false/> + <key>IS_SIGNIN_ENABLED</key> + <true/> + <key>GOOGLE_APP_ID</key> + <string>1:15087385131:ios:d547168abe3c362f</string> + <key>DATABASE_URL</key> + <string>https://grpc-authsample.firebaseio.com</string> </dict> -</plist>
\ No newline at end of file +</plist> diff --git a/examples/objective-c/auth_sample/Podfile b/examples/objective-c/auth_sample/Podfile index 7affe08743..a25d20f477 100644 --- a/examples/objective-c/auth_sample/Podfile +++ b/examples/objective-c/auth_sample/Podfile @@ -1,9 +1,7 @@ source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' -pod 'Protobuf', :path => "../../../third_party/protobuf" -pod 'BoringSSL', :podspec => "../../../src/objective-c" -pod 'gRPC', :path => "../../.." +install! 'cocoapods', :deterministic_uuids => false target 'AuthSample' do # Depend on the generated AuthTestService library. diff --git a/examples/objective-c/helloworld/HelloWorld.podspec b/examples/objective-c/helloworld/HelloWorld.podspec index 17b016b31a..48364fc0af 100644 --- a/examples/objective-c/helloworld/HelloWorld.podspec +++ b/examples/objective-c/helloworld/HelloWorld.podspec @@ -13,27 +13,51 @@ Pod::Spec.new do |s| # Base directory where the .proto files are. src = "../../protos" + # Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients. + s.dependency "!ProtoCompiler-gRPCPlugin", "~> 1.0.0-pre1" + + # 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/" + s.name + dir = "#{pods_root}/#{s.name}" - # Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients. s.prepare_command = <<-CMD mkdir -p #{dir} - protoc -I #{src} --objc_out=#{dir} --objcgrpc_out=#{dir} #{src}/helloworld.proto + #{protoc} \ + --plugin=protoc-gen-grpc=#{plugin} \ + --objc_out=#{dir} \ + --grpc_out=#{dir} \ + -I #{src} \ + -I #{protoc_dir} \ + #{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 - ms.dependency "Protobuf", "~> 3.0.0-alpha-4" + # 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 = { + 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1', + } 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 - ss.dependency "gRPC", "~> 0.12" + # 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 end diff --git a/examples/objective-c/helloworld/Podfile b/examples/objective-c/helloworld/Podfile index eebf05470d..0c3feaa47e 100644 --- a/examples/objective-c/helloworld/Podfile +++ b/examples/objective-c/helloworld/Podfile @@ -1,9 +1,7 @@ source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' -pod 'Protobuf', :path => "../../../third_party/protobuf" -pod 'BoringSSL', :podspec => "../../../src/objective-c" -pod 'gRPC', :path => "../../.." +install! 'cocoapods', :deterministic_uuids => false target 'HelloWorld' do # Depend on the generated HelloWorld library. diff --git a/examples/objective-c/route_guide/Podfile b/examples/objective-c/route_guide/Podfile index b9f2fefd6d..b77eb1b11d 100644 --- a/examples/objective-c/route_guide/Podfile +++ b/examples/objective-c/route_guide/Podfile @@ -1,10 +1,9 @@ source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' +install! 'cocoapods', :deterministic_uuids => false + target 'RouteGuideClient' do - pod 'Protobuf', :path => "../../../third_party/protobuf" - pod 'BoringSSL', :podspec => "../../../src/objective-c" - pod 'gRPC', :path => "../../.." # Depend on the generated RouteGuide library. pod 'RouteGuide', :path => '.' end diff --git a/examples/objective-c/route_guide/RouteGuide.podspec b/examples/objective-c/route_guide/RouteGuide.podspec index 97a61ff51a..04bc10bc0b 100644 --- a/examples/objective-c/route_guide/RouteGuide.podspec +++ b/examples/objective-c/route_guide/RouteGuide.podspec @@ -13,27 +13,51 @@ Pod::Spec.new do |s| # Base directory where the .proto files are. src = "../../protos" + # Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients. + s.dependency "!ProtoCompiler-gRPCPlugin", "~> 1.0.0-pre1" + + # 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/" + s.name + dir = "#{pods_root}/#{s.name}" - # Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients. s.prepare_command = <<-CMD mkdir -p #{dir} - protoc -I #{src} --objc_out=#{dir} --objcgrpc_out=#{dir} #{src}/route_guide.proto + #{protoc} \ + --plugin=protoc-gen-grpc=#{plugin} \ + --objc_out=#{dir} \ + --grpc_out=#{dir} \ + -I #{src} \ + -I #{protoc_dir} \ + #{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 - ms.dependency "Protobuf", "~> 3.0.0-alpha-4" + # 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 = { + 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1', + } 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 - ss.dependency "gRPC", "~> 0.12" + # 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 end |