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
20PROTOC=bins/opt/protobuf/protoc
21PLUGIN=protoc-gen-grpc=bins/opt/grpc_ruby_plugin
22
23$PROTOC -I src/proto src/proto/grpc/health/v1/health.proto \
24    --grpc_out=src/ruby/pb \
25    --ruby_out=src/ruby/pb \
26    --plugin=$PLUGIN
27
28$PROTOC -I . \
29    src/proto/grpc/testing/{messages,test,empty}.proto \
30    --grpc_out=src/ruby/pb \
31    --ruby_out=src/ruby/pb \
32    --plugin=$PLUGIN
33
34$PROTOC -I . \
35    src/proto/grpc/core/stats.proto \
36    --grpc_out=src/ruby/qps \
37    --ruby_out=src/ruby/qps \
38    --plugin=$PLUGIN
39
40$PROTOC -I . \
41    src/proto/grpc/testing/{messages,payloads,stats,benchmark_service,report_qps_scenario_service,worker_service,control}.proto \
42    --grpc_out=src/ruby/qps \
43    --ruby_out=src/ruby/qps \
44    --plugin=$PLUGIN
45
46$PROTOC -I src/proto/math src/proto/math/math.proto \
47    --grpc_out=src/ruby/bin \
48    --ruby_out=src/ruby/bin \
49    --plugin=$PLUGIN
50