echoapi.podspec 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. Pod::Spec.new do |s|
  2. s.name = 'echoapi'
  3. s.version = '0.0.1'
  4. s.license = 'Apache 2.0'
  5. s.authors = { 'Google Inc.' => 'timburks@google.com'}
  6. s.homepage = 'http://github.com/GoogleCloudPlatform/ios-docs-samples'
  7. s.source = { :git => 'https://github.com/GoogleCloudPlatform/ios-docs-samples.git',
  8. :tag => '0.0.1' }
  9. s.summary = 'Echo Sample API'
  10. s.ios.deployment_target = '7.1'
  11. s.osx.deployment_target = '10.9'
  12. # Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients.
  13. s.dependency "!ProtoCompiler-gRPCPlugin", "~> 1.0.0-pre1.1"
  14. # Pods directory corresponding to this app's Podfile, relative to the location of this podspec.
  15. pods_root = '../Pods'
  16. # Path where Cocoapods downloads protoc and the gRPC plugin.
  17. protoc_dir = "#{pods_root}/!ProtoCompiler"
  18. protoc = "#{protoc_dir}/protoc"
  19. plugin = "#{pods_root}/!ProtoCompiler-gRPCPlugin/grpc_objective_c_plugin"
  20. # Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients.
  21. # You can run this command manually if you later change your protos and need to regenerate.
  22. s.prepare_command = <<-CMD
  23. #{protoc} \
  24. --plugin=protoc-gen-grpc=#{plugin} \
  25. --objc_out=. \
  26. --grpc_out=. \
  27. -I . \
  28. -I #{protoc_dir} \
  29. *.proto
  30. CMD
  31. # The --objc_out plugin generates a pair of .pbobjc.h/.pbobjc.m files for each .proto file.
  32. s.subspec "Messages" do |ms|
  33. ms.source_files = "*.pbobjc.{h,m}"
  34. ms.header_mappings_dir = "."
  35. ms.requires_arc = false
  36. ms.dependency "Protobuf"
  37. end
  38. # The --objcgrpc_out plugin generates a pair of .pbrpc.h/.pbrpc.m files for each .proto file with
  39. # a service defined.
  40. s.subspec "Services" do |ss|
  41. ss.source_files = "*.pbrpc.{h,m}"
  42. ss.header_mappings_dir = "."
  43. ss.requires_arc = true
  44. ss.dependency "gRPC-ProtoRPC"
  45. ss.dependency "#{s.name}/Messages"
  46. end
  47. s.pod_target_xcconfig = {
  48. 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
  49. 'USER_HEADER_SEARCH_PATHS' => '$SRCROOT/..'
  50. }
  51. end