UU_Ent.podspec 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. Pod::Spec.new do |s|
  2. s.name = "UU_Ent"
  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 = "GRPCOne example"
  8. s.source = { :git => 'https://github.com/grpc/grpc.git' }
  9. s.ios.deployment_target = "7.1"
  10. s.osx.deployment_target = "10.9"
  11. # Base directory where the .proto files are.
  12. src = "protos"
  13. # Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients.
  14. s.dependency "!ProtoCompiler-gRPCPlugin", "~> 1.0"
  15. # Pods directory corresponding to this app's Podfile, relative to the location of this podspec.
  16. pods_root = 'Pods'
  17. # Path where Cocoapods downloads protoc and the gRPC plugin.
  18. protoc_dir = "#{pods_root}/!ProtoCompiler"
  19. protoc = "#{protoc_dir}/protoc"
  20. plugin = "#{pods_root}/!ProtoCompiler-gRPCPlugin/grpc_objective_c_plugin"
  21. # Directory where the generated files will be placed.
  22. dir = "#{pods_root}/#{s.name}"
  23. s.prepare_command = <<-CMD
  24. mkdir -p #{dir}
  25. #{protoc} \
  26. --plugin=protoc-gen-grpc=#{plugin} \
  27. --objc_out=#{dir} \
  28. --grpc_out=#{dir} \
  29. -I #{src} \
  30. -I #{protoc_dir} \
  31. #{src}/base.proto\
  32. #{src}/account.proto\
  33. #{src}/message.proto\
  34. CMD
  35. # Files generated by protoc
  36. s.subspec "Messages" do |ms|
  37. ms.source_files = "#{dir}/*.pbobjc.{h,m}", "#{dir}/**/*.pbobjc.{h,m}"
  38. ms.header_mappings_dir = dir
  39. ms.requires_arc = false
  40. # The generated files depend on the protobuf runtime.
  41. ms.dependency "Protobuf"
  42. end
  43. # Files generated by the gRPC plugin
  44. s.subspec "Services" do |ss|
  45. ss.source_files = "#{dir}/*.pbrpc.{h,m}", "#{dir}/**/*.pbrpc.{h,m}"
  46. ss.header_mappings_dir = dir
  47. ss.requires_arc = true
  48. # The generated files depend on the gRPC runtime, and on the files generated by protoc.
  49. ss.dependency "gRPC-ProtoRPC"
  50. ss.dependency "#{s.name}/Messages"
  51. end
  52. s.pod_target_xcconfig = {
  53. # This is needed by all pods that depend on Protobuf:
  54. 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1',
  55. # This is needed by all pods that depend on gRPC-RxLibrary:
  56. 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES',
  57. }
  58. end