-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to generate LND ruby GRPC service files
- Loading branch information
Showing
2 changed files
with
33 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/sh | ||
set -o xtrace | ||
|
||
FULL_PATH=$(realpath $0) | ||
GEM_DIR=$(dirname $FULL_PATH) | ||
LNRPC_TARGET_DIR="$GEM_DIR/lib/grpc_services" | ||
CURRENT_DIR=$(pwd) | ||
echo $CURRENT_DIR | ||
cd $GOPATH/src/github.com/lightningnetwork/lnd/lnrpc | ||
|
||
echo "Generating Ruby GRPC Service Files" | ||
|
||
PROTOS="rpc.proto walletunlocker.proto **/*.proto" | ||
|
||
# generate files for each proto | ||
for file in $PROTOS; do | ||
DIRECTORY=$(dirname "${file}") | ||
echo "Generating protos from ${file}, into ${LNRPC_TARGET_DIR}/${DIRECTORY}" | ||
|
||
# writes all ruby files in the ruby directory | ||
grpc_tools_ruby_protoc -I/usr/local/include \ | ||
-I. \ | ||
-I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \ | ||
-I$GOPATH/src/github.com/lightningnetwork/lnd/lnrpc \ | ||
--ruby_out=plugins=grpc,paths=source_relative:${LNRPC_TARGET_DIR} \ | ||
--grpc_out=${LNRPC_TARGET_DIR} "${file}" | ||
|
||
done | ||
|
||
cd $CURRENT_DIR |