generate_proto_ruby.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/bin/sh
  2. # Copyright 2015 gRPC authors.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. # Regenerates gRPC service stubs from proto files.
  16. set -e
  17. cd $(dirname $0)/../../..
  18. # protoc and grpc_*_plugin binaries can be obtained by running
  19. # $ bazel build @com_google_protobuf//:protoc //src/compiler:all
  20. PROTOC=bazel-bin/external/com_google_protobuf/protoc
  21. PLUGIN=protoc-gen-grpc=bazel-bin/src/compiler/grpc_ruby_plugin
  22. $PROTOC -I src/proto src/proto/grpc/health/v1/health.proto \
  23. --grpc_out=src/ruby/pb \
  24. --ruby_out=src/ruby/pb \
  25. --plugin=$PLUGIN
  26. $PROTOC -I . \
  27. src/proto/grpc/testing/{messages,test,empty}.proto \
  28. --grpc_out=src/ruby/pb \
  29. --ruby_out=src/ruby/pb \
  30. --plugin=$PLUGIN
  31. $PROTOC -I . \
  32. src/proto/grpc/core/stats.proto \
  33. --grpc_out=src/ruby/qps \
  34. --ruby_out=src/ruby/qps \
  35. --plugin=$PLUGIN
  36. $PROTOC -I . \
  37. src/proto/grpc/testing/{messages,payloads,stats,benchmark_service,report_qps_scenario_service,worker_service,control}.proto \
  38. --grpc_out=src/ruby/qps \
  39. --ruby_out=src/ruby/qps \
  40. --plugin=$PLUGIN
  41. $PROTOC -I src/proto/math src/proto/math/math.proto \
  42. --grpc_out=src/ruby/bin \
  43. --ruby_out=src/ruby/bin \
  44. --plugin=$PLUGIN