blob: ea5d678cba26690a4369432ebfdcb569d08af91e [file] [log] [blame]
Jan Tattermuscheb5a3122015-05-07 15:06:35 -07001#!/bin/sh
Craig Tiller6169d5f2016-03-31 07:46:18 -07002# Copyright 2015, Google Inc.
Jan Tattermuscheb5a3122015-05-07 15:06:35 -07003# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met:
8#
9# * Redistributions of source code must retain the above copyright
10# notice, this list of conditions and the following disclaimer.
11# * Redistributions in binary form must reproduce the above
12# copyright notice, this list of conditions and the following disclaimer
13# in the documentation and/or other materials provided with the
14# distribution.
15# * Neither the name of Google Inc. nor the names of its
16# contributors may be used to endorse or promote products derived from
17# this software without specific prior written permission.
18#
19# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
31# Regenerates gRPC service stubs from proto files.
32set +e
Jan Tattermusche8132d32015-12-07 09:19:34 -080033cd $(dirname $0)/../..
Jan Tattermuscheb5a3122015-05-07 15:06:35 -070034
Jan Tattermusche8132d32015-12-07 09:19:34 -080035PROTOC=bins/opt/protobuf/protoc
36PLUGIN=protoc-gen-grpc=bins/opt/grpc_csharp_plugin
37EXAMPLES_DIR=src/csharp/Grpc.Examples
38HEALTHCHECK_DIR=src/csharp/Grpc.HealthCheck
Jan Tattermusch02017762016-11-23 15:39:56 +010039REFLECTION_DIR=src/csharp/Grpc.Reflection
Jan Tattermusche8132d32015-12-07 09:19:34 -080040TESTING_DIR=src/csharp/Grpc.IntegrationTesting
Jan Tattermuscheb5a3122015-05-07 15:06:35 -070041
Jan Tattermusch2c4f4ec2015-08-03 08:10:48 -070042$PROTOC --plugin=$PLUGIN --csharp_out=$EXAMPLES_DIR --grpc_out=$EXAMPLES_DIR \
Jan Tattermusch091057a2016-11-24 13:08:45 +010043 -I src/proto src/proto/math/math.proto
Jan Tattermuschb5332812015-07-14 19:29:35 -070044
Jan Tattermusch2c4f4ec2015-08-03 08:10:48 -070045$PROTOC --plugin=$PLUGIN --csharp_out=$HEALTHCHECK_DIR --grpc_out=$HEALTHCHECK_DIR \
Jan Tattermusch091057a2016-11-24 13:08:45 +010046 -I src/proto src/proto/grpc/health/v1/health.proto
Jan Tattermusch02017762016-11-23 15:39:56 +010047
48$PROTOC --plugin=$PLUGIN --csharp_out=$REFLECTION_DIR --grpc_out=$REFLECTION_DIR \
Jan Tattermusch091057a2016-11-24 13:08:45 +010049 -I src/proto src/proto/grpc/reflection/v1alpha/reflection.proto
Jan Tattermusche8132d32015-12-07 09:19:34 -080050
Jan Tattermusch091057a2016-11-24 13:08:45 +010051# TODO(jtattermusch): following .proto files are a bit broken and import paths
52# don't match the package names. Setting -I to the correct value src/proto
53# breaks the code generation.
Jan Tattermusche8132d32015-12-07 09:19:34 -080054$PROTOC --plugin=$PLUGIN --csharp_out=$TESTING_DIR --grpc_out=$TESTING_DIR \
Jan Tattermusch445a82b2016-04-21 13:18:26 -070055 -I . src/proto/grpc/testing/{control,empty,messages,metrics,payloads,services,stats,test}.proto