From 0432f7f6ca1ded1de8fd365dd074aedbfb28c3c5 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 17 Apr 2020 12:52:17 +0200 Subject: [PATCH] use bazel-built protoc and plugin for generate_proto_*.sh scripts modify scripts --- src/csharp/generate_proto_csharp.sh | 7 +++++-- src/php/bin/generate_proto_php.sh | 13 +++++++++---- src/ruby/pb/generate_proto_ruby.sh | 6 ++++-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/csharp/generate_proto_csharp.sh b/src/csharp/generate_proto_csharp.sh index e79728ff959..c6ef27e2290 100755 --- a/src/csharp/generate_proto_csharp.sh +++ b/src/csharp/generate_proto_csharp.sh @@ -17,8 +17,11 @@ set +e cd $(dirname $0)/../.. -PROTOC=bins/opt/protobuf/protoc -PLUGIN=protoc-gen-grpc=bins/opt/grpc_csharp_plugin +# protoc and grpc_*_plugin binaries can be obtained by running +# $ bazel build @com_google_protobuf//:protoc //src/compiler:all +PROTOC=bazel-bin/external/com_google_protobuf/protoc +PLUGIN=protoc-gen-grpc=bazel-bin/src/compiler/grpc_csharp_plugin + EXAMPLES_DIR=src/csharp/Grpc.Examples HEALTHCHECK_DIR=src/csharp/Grpc.HealthCheck REFLECTION_DIR=src/csharp/Grpc.Reflection diff --git a/src/php/bin/generate_proto_php.sh b/src/php/bin/generate_proto_php.sh index 42d5b642431..d7c0a593e4a 100755 --- a/src/php/bin/generate_proto_php.sh +++ b/src/php/bin/generate_proto_php.sh @@ -16,10 +16,15 @@ set +e cd $(dirname $0)/../../.. -protoc --proto_path=src/proto/math \ +# protoc and grpc_*_plugin binaries can be obtained by running +# $ bazel build @com_google_protobuf//:protoc //src/compiler:all +PROTOC=bazel-bin/external/com_google_protobuf/protoc +PLUGIN=protoc-gen-grpc=bazel-bin/src/compiler/grpc_php_plugin + +$PROTOC --proto_path=src/proto/math \ --php_out=src/php/tests/generated_code \ --grpc_out=src/php/tests/generated_code \ - --plugin=protoc-gen-grpc=bins/opt/grpc_php_plugin \ + --plugin=$PLUGIN \ src/proto/math/math.proto # replace the Empty message with EmptyMessage @@ -32,10 +37,10 @@ sed 's/grpc\.testing\.Empty/grpc\.testing\.EmptyMessage/g' \ src/proto/grpc/testing/test.proto > $output_file mv $output_file ./src/proto/grpc/testing/test.proto -protoc --proto_path=. \ +$PROTOC --proto_path=. \ --php_out=src/php/tests/interop \ --grpc_out=src/php/tests/interop \ - --plugin=protoc-gen-grpc=bins/opt/grpc_php_plugin \ + --plugin=$PLUGIN \ src/proto/grpc/testing/messages.proto \ src/proto/grpc/testing/empty.proto \ src/proto/grpc/testing/test.proto diff --git a/src/ruby/pb/generate_proto_ruby.sh b/src/ruby/pb/generate_proto_ruby.sh index ec6e2eedd1e..01eccba94da 100755 --- a/src/ruby/pb/generate_proto_ruby.sh +++ b/src/ruby/pb/generate_proto_ruby.sh @@ -17,8 +17,10 @@ set +e cd $(dirname $0)/../../.. -PROTOC=bins/opt/protobuf/protoc -PLUGIN=protoc-gen-grpc=bins/opt/grpc_ruby_plugin +# protoc and grpc_*_plugin binaries can be obtained by running +# $ bazel build @com_google_protobuf//:protoc //src/compiler:all +PROTOC=bazel-bin/external/com_google_protobuf/protoc +PLUGIN=protoc-gen-grpc=bazel-bin/src/compiler/grpc_ruby_plugin $PROTOC -I src/proto src/proto/grpc/health/v1/health.proto \ --grpc_out=src/ruby/pb \