产生新的原型

时间:2019-01-24 22:13:40

标签: objective-c cocoapods grpc

我有一个<Podspec file name>.podspec相当于standard GRPC

我不知道如何在此处运行生成新.pbobjc.h/.pbobjc.m files for each .proto file.

的脚本

有人知道我应该在命令行中运行什么命令来触发根据.podspec文件中的脚本生成这些新文件吗?

.podspec中的脚本还有更多上下文:

      # Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients.
  # You can run this command manually if you later change your protos and need to regenerate.
  # Alternatively, you can advance the version of this podspec and run `pod update`.
  s.prepare_command = <<-CMD
    mkdir -p #{dir}
    #{protoc} \
        --plugin=protoc-gen-grpc=#{plugin} \
        --objc_out="Pods/LndRpc" \
        --grpc_out="Pods/LndRpc" \
        -I $GOPATH/src \
        -I $GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
        -I "Pods/!ProtoCompiler" \
        -I "." \
        ./*.proto
  CMD

  # The --objc_out plugin generates a pair of .pbobjc.h/.pbobjc.m files for each .proto file.
  s.subspec 'Messages' do |ms|
    ms.source_files = "#{dir}/*.pbobjc.{h,m}"
    ms.header_mappings_dir = dir
    ms.requires_arc = false
    # The generated files depend on the protobuf runtime.
    ms.dependency 'Protobuf'
  end

  # The --objcgrpc_out plugin generates a pair of .pbrpc.h/.pbrpc.m files for each .proto file with
  # a service defined.
  s.subspec 'Services' do |ss|
    ss.source_files = "#{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 `--objc_out`.
    ss.dependency 'gRPC-ProtoRPC'
    ss.dependency "#{s.name}/Messages"
  end

0 个答案:

没有答案