• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
16# Regenerates gRPC service stubs from proto files.
17set -e
18cd $(dirname $0)/../../..
19
20# protoc and grpc_*_plugin binaries can be obtained by running
21# $ bazel build @com_google_protobuf//:protoc //src/compiler:all
22PROTOC=bazel-bin/external/com_google_protobuf/protoc
23PLUGIN=protoc-gen-grpc=bazel-bin/src/compiler/grpc_ruby_plugin
24
25$PROTOC -I src/proto src/proto/grpc/health/v1/health.proto \
26    --grpc_out=src/ruby/pb \
27    --ruby_out=src/ruby/pb \
28    --plugin=$PLUGIN
29
30$PROTOC -I . \
31    src/proto/grpc/testing/{messages,test,empty}.proto \
32    --grpc_out=src/ruby/pb \
33    --ruby_out=src/ruby/pb \
34    --plugin=$PLUGIN
35
36$PROTOC -I . \
37    -I third_party/protobuf/src \
38    src/proto/grpc/testing/{messages,payloads,stats,benchmark_service,report_qps_scenario_service,worker_service,control}.proto \
39    --grpc_out=src/ruby/qps \
40    --ruby_out=src/ruby/qps \
41    --plugin=$PLUGIN
42
43$PROTOC -I src/proto/math src/proto/math/math.proto \
44    --grpc_out=src/ruby/bin \
45    --ruby_out=src/ruby/bin \
46    --plugin=$PLUGIN
47