lnrpc: add new recursive proto generation script
In this commit, we add a recursive proto generation script. This avoids having to add a new script for each upcoming sub-server.
This commit is contained in:
4 files changed
+34
-17
No files matched your search
+15
-2
@@ -1,5 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Generating root gRPC server protos"
|
||||
|
||||
# Generate the protos.
|
||||
protoc -I/usr/local/include -I. \
|
||||
-I$GOPATH/src \
|
||||
@@ -7,8 +9,6 @@ protoc -I/usr/local/include -I. \
|
||||
--go_out=plugins=grpc:. \
|
||||
rpc.proto
|
||||
|
||||
|
||||
|
||||
# Generate the REST reverse proxy.
|
||||
protoc -I/usr/local/include -I. \
|
||||
-I$GOPATH/src \
|
||||
@@ -22,3 +22,16 @@ protoc -I/usr/local/include -I. \
|
||||
-I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
|
||||
--swagger_out=logtostderr=true:. \
|
||||
rpc.proto
|
||||
|
||||
# For each of the sub-servers, we then generate their protos, but a restricted
|
||||
# set as they don't yet require REST proxies, or swagger docs.
|
||||
for file in **/*.proto
|
||||
do
|
||||
DIRECTORY=$(dirname ${file})
|
||||
echo "Generating protos from ${file}, into ${DIRECTORY}"
|
||||
|
||||
protoc -I/usr/local/include -I. \
|
||||
-I$GOPATH/src \
|
||||
--go_out=plugins=grpc:. \
|
||||
${file}
|
||||
done
|
||||
Reference in new issue
Block a user