buildscripts: Add script to sync .protos from grpc-proto

Currently only protos in alts, grpclb, and services are synced. Once
some java_package options are "upstreamed", benchmarks and
interop-testing could also be synced.
This commit is contained in:
Eric Anderson 2018-12-20 16:47:16 -07:00 committed by GitHub
parent 9eeceab597
commit 186409f868
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 83 additions and 54 deletions

30
buildscripts/sync-protos.sh Executable file
View File

@ -0,0 +1,30 @@
#!/bin/bash
set -e
cd "$(dirname "$0")/.."
tmpdir="$(mktemp -d)"
curl -Ls https://github.com/grpc/grpc-proto/archive/master.tar.gz | tar xz -C "$tmpdir"
base="$tmpdir/grpc-proto-master"
# Copy protos in 'src/main/proto' from grpc-proto for these projects
for project in alts grpclb services; do
while read -r proto; do
[ -f "$base/$proto" ] && cp "$base/$proto" "$project/src/main/proto/$proto"
echo "$proto"
done < <(cd "$project/src/main/proto" && find . -name "*.proto")
done | sort > "$tmpdir/grpc-java.lst"
(cd "$base" && find . -name "*.proto") | sort > "$tmpdir/base.lst"
echo "Files synced:"
comm -12 "$tmpdir/grpc-java.lst" "$tmpdir/base.lst"
echo
echo "Files in grpc-proto not synced:"
comm -13 "$tmpdir/grpc-java.lst" "$tmpdir/base.lst"
echo
echo "Files in grpc-java not synced:"
comm -23 "$tmpdir/grpc-java.lst" "$tmpdir/base.lst"
rm -r "$tmpdir"

View File

@ -19,7 +19,7 @@ import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
*/ */
@javax.annotation.Generated( @javax.annotation.Generated(
value = "by gRPC proto compiler", value = "by gRPC proto compiler",
comments = "Source: io/grpc/reflection/v1alpha/reflection.proto") comments = "Source: grpc/reflection/v1alpha/reflection.proto")
public final class ServerReflectionGrpc { public final class ServerReflectionGrpc {
private ServerReflectionGrpc() {} private ServerReflectionGrpc() {}

View File

@ -1,5 +1,5 @@
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: io/grpc/reflection/v1alpha/reflection.proto // source: grpc/reflection/v1alpha/reflection.proto
package io.grpc.reflection.v1alpha; package io.grpc.reflection.v1alpha;

View File

@ -1,5 +1,5 @@
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: io/grpc/reflection/v1alpha/reflection.proto // source: grpc/reflection/v1alpha/reflection.proto
package io.grpc.reflection.v1alpha; package io.grpc.reflection.v1alpha;

View File

@ -1,5 +1,5 @@
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: io/grpc/reflection/v1alpha/reflection.proto // source: grpc/reflection/v1alpha/reflection.proto
package io.grpc.reflection.v1alpha; package io.grpc.reflection.v1alpha;

View File

@ -1,5 +1,5 @@
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: io/grpc/reflection/v1alpha/reflection.proto // source: grpc/reflection/v1alpha/reflection.proto
package io.grpc.reflection.v1alpha; package io.grpc.reflection.v1alpha;

View File

@ -1,5 +1,5 @@
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: io/grpc/reflection/v1alpha/reflection.proto // source: grpc/reflection/v1alpha/reflection.proto
package io.grpc.reflection.v1alpha; package io.grpc.reflection.v1alpha;

View File

@ -1,5 +1,5 @@
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: io/grpc/reflection/v1alpha/reflection.proto // source: grpc/reflection/v1alpha/reflection.proto
package io.grpc.reflection.v1alpha; package io.grpc.reflection.v1alpha;

View File

@ -1,5 +1,5 @@
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: io/grpc/reflection/v1alpha/reflection.proto // source: grpc/reflection/v1alpha/reflection.proto
package io.grpc.reflection.v1alpha; package io.grpc.reflection.v1alpha;

View File

@ -1,5 +1,5 @@
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: io/grpc/reflection/v1alpha/reflection.proto // source: grpc/reflection/v1alpha/reflection.proto
package io.grpc.reflection.v1alpha; package io.grpc.reflection.v1alpha;

View File

@ -1,5 +1,5 @@
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: io/grpc/reflection/v1alpha/reflection.proto // source: grpc/reflection/v1alpha/reflection.proto
package io.grpc.reflection.v1alpha; package io.grpc.reflection.v1alpha;

View File

@ -1,5 +1,5 @@
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: io/grpc/reflection/v1alpha/reflection.proto // source: grpc/reflection/v1alpha/reflection.proto
package io.grpc.reflection.v1alpha; package io.grpc.reflection.v1alpha;

View File

@ -1,5 +1,5 @@
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: io/grpc/reflection/v1alpha/reflection.proto // source: grpc/reflection/v1alpha/reflection.proto
package io.grpc.reflection.v1alpha; package io.grpc.reflection.v1alpha;
@ -63,42 +63,41 @@ package io.grpc.reflection.v1alpha;
descriptor; descriptor;
static { static {
java.lang.String[] descriptorData = { java.lang.String[] descriptorData = {
"\n+io/grpc/reflection/v1alpha/reflection." + "\n(grpc/reflection/v1alpha/reflection.pro" +
"proto\022\027grpc.reflection.v1alpha\"\212\002\n\027Serve" + "to\022\027grpc.reflection.v1alpha\"\212\002\n\027ServerRe" +
"rReflectionRequest\022\014\n\004host\030\001 \001(\t\022\032\n\020file" + "flectionRequest\022\014\n\004host\030\001 \001(\t\022\032\n\020file_by" +
"_by_filename\030\003 \001(\tH\000\022 \n\026file_containing_" + "_filename\030\003 \001(\tH\000\022 \n\026file_containing_sym" +
"symbol\030\004 \001(\tH\000\022N\n\031file_containing_extens" + "bol\030\004 \001(\tH\000\022N\n\031file_containing_extension" +
"ion\030\005 \001(\0132).grpc.reflection.v1alpha.Exte" + "\030\005 \001(\0132).grpc.reflection.v1alpha.Extensi" +
"nsionRequestH\000\022\'\n\035all_extension_numbers_" + "onRequestH\000\022\'\n\035all_extension_numbers_of_" +
"of_type\030\006 \001(\tH\000\022\027\n\rlist_services\030\007 \001(\tH\000" + "type\030\006 \001(\tH\000\022\027\n\rlist_services\030\007 \001(\tH\000B\021\n" +
"B\021\n\017message_request\"E\n\020ExtensionRequest\022" + "\017message_request\"E\n\020ExtensionRequest\022\027\n\017" +
"\027\n\017containing_type\030\001 \001(\t\022\030\n\020extension_nu" + "containing_type\030\001 \001(\t\022\030\n\020extension_numbe" +
"mber\030\002 \001(\005\"\321\003\n\030ServerReflectionResponse\022" + "r\030\002 \001(\005\"\321\003\n\030ServerReflectionResponse\022\022\n\n" +
"\022\n\nvalid_host\030\001 \001(\t\022J\n\020original_request\030" + "valid_host\030\001 \001(\t\022J\n\020original_request\030\002 \001" +
"\002 \001(\01320.grpc.reflection.v1alpha.ServerRe" + "(\01320.grpc.reflection.v1alpha.ServerRefle" +
"flectionRequest\022S\n\030file_descriptor_respo" + "ctionRequest\022S\n\030file_descriptor_response" +
"nse\030\004 \001(\0132/.grpc.reflection.v1alpha.File" + "\030\004 \001(\0132/.grpc.reflection.v1alpha.FileDes" +
"DescriptorResponseH\000\022Z\n\036all_extension_nu" + "criptorResponseH\000\022Z\n\036all_extension_numbe" +
"mbers_response\030\005 \001(\01320.grpc.reflection.v" + "rs_response\030\005 \001(\01320.grpc.reflection.v1al" +
"1alpha.ExtensionNumberResponseH\000\022N\n\026list" + "pha.ExtensionNumberResponseH\000\022N\n\026list_se" +
"_services_response\030\006 \001(\0132,.grpc.reflecti" + "rvices_response\030\006 \001(\0132,.grpc.reflection." +
"on.v1alpha.ListServiceResponseH\000\022@\n\016erro" + "v1alpha.ListServiceResponseH\000\022@\n\016error_r" +
"r_response\030\007 \001(\0132&.grpc.reflection.v1alp" + "esponse\030\007 \001(\0132&.grpc.reflection.v1alpha." +
"ha.ErrorResponseH\000B\022\n\020message_response\"7" + "ErrorResponseH\000B\022\n\020message_response\"7\n\026F" +
"\n\026FileDescriptorResponse\022\035\n\025file_descrip" + "ileDescriptorResponse\022\035\n\025file_descriptor" +
"tor_proto\030\001 \003(\014\"K\n\027ExtensionNumberRespon" + "_proto\030\001 \003(\014\"K\n\027ExtensionNumberResponse\022" +
"se\022\026\n\016base_type_name\030\001 \001(\t\022\030\n\020extension_" + "\026\n\016base_type_name\030\001 \001(\t\022\030\n\020extension_num" +
"number\030\002 \003(\005\"P\n\023ListServiceResponse\0229\n\007s" + "ber\030\002 \003(\005\"P\n\023ListServiceResponse\0229\n\007serv" +
"ervice\030\001 \003(\0132(.grpc.reflection.v1alpha.S" + "ice\030\001 \003(\0132(.grpc.reflection.v1alpha.Serv" +
"erviceResponse\"\037\n\017ServiceResponse\022\014\n\004nam" + "iceResponse\"\037\n\017ServiceResponse\022\014\n\004name\030\001" +
"e\030\001 \001(\t\":\n\rErrorResponse\022\022\n\nerror_code\030\001" + " \001(\t\":\n\rErrorResponse\022\022\n\nerror_code\030\001 \001(" +
" \001(\005\022\025\n\rerror_message\030\002 \001(\t2\223\001\n\020ServerRe" + "\005\022\025\n\rerror_message\030\002 \001(\t2\223\001\n\020ServerRefle" +
"flection\022\177\n\024ServerReflectionInfo\0220.grpc." + "ction\022\177\n\024ServerReflectionInfo\0220.grpc.ref" +
"reflection.v1alpha.ServerReflectionReque" + "lection.v1alpha.ServerReflectionRequest\032" +
"st\0321.grpc.reflection.v1alpha.ServerRefle" + "1.grpc.reflection.v1alpha.ServerReflecti" +
"ctionResponse(\0010\001B8\n\032io.grpc.reflection." + "onResponse(\0010\001B8\n\032io.grpc.reflection.v1a" +
"v1alphaB\025ServerReflectionProtoP\001\270\001\001b\006pro" + "lphaB\025ServerReflectionProtoP\001\270\001\001b\006proto3"
"to3"
}; };
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {

View File

@ -1,5 +1,5 @@
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: io/grpc/reflection/v1alpha/reflection.proto // source: grpc/reflection/v1alpha/reflection.proto
package io.grpc.reflection.v1alpha; package io.grpc.reflection.v1alpha;

View File

@ -1,5 +1,5 @@
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: io/grpc/reflection/v1alpha/reflection.proto // source: grpc/reflection/v1alpha/reflection.proto
package io.grpc.reflection.v1alpha; package io.grpc.reflection.v1alpha;

View File

@ -1,5 +1,5 @@
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: io/grpc/reflection/v1alpha/reflection.proto // source: grpc/reflection/v1alpha/reflection.proto
package io.grpc.reflection.v1alpha; package io.grpc.reflection.v1alpha;

View File

@ -1,5 +1,5 @@
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: io/grpc/reflection/v1alpha/reflection.proto // source: grpc/reflection/v1alpha/reflection.proto
package io.grpc.reflection.v1alpha; package io.grpc.reflection.v1alpha;

View File

@ -1,5 +1,5 @@
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: io/grpc/reflection/v1alpha/reflection.proto // source: grpc/reflection/v1alpha/reflection.proto
package io.grpc.reflection.v1alpha; package io.grpc.reflection.v1alpha;

View File

@ -1,5 +1,5 @@
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: io/grpc/reflection/v1alpha/reflection.proto // source: grpc/reflection/v1alpha/reflection.proto
package io.grpc.reflection.v1alpha; package io.grpc.reflection.v1alpha;