bdledger-apis/scripts/gen-nodejs.bat

20 lines
1.0 KiB
Batchfile
Raw Normal View History

2020-03-14 13:48:59 +00:00
@echo off
cd /d "%~dp0.."
set dir=.\gen\nodejs
set exe=grpc_tools_node_protoc
2020-03-15 02:47:53 +00:00
set plugin=grpc_tools_node_protoc_plugin
2020-03-14 13:48:59 +00:00
where /q %exe% || echo missing %exe% && exit /B
2020-03-15 02:47:53 +00:00
where /q %plugin% || echo missing %plugin% && exit /B
for /f %%i in ('where %plugin%') do set pluginPath=%%i
2020-03-14 13:48:59 +00:00
if not exist %dir% mkdir %dir%
2020-03-15 02:47:53 +00:00
call %exe% -I . --js_out=import_style=commonjs,binary:%dir% --grpc_out=%dir% --plugin=protoc-gen-grpc=%pluginPath% bdledger/api/common.proto
call %exe% -I . --js_out=import_style=commonjs,binary:%dir% --grpc_out=%dir% --plugin=protoc-gen-grpc=%pluginPath% bdledger/api/error_details.proto
call %exe% -I . --js_out=import_style=commonjs,binary:%dir% --grpc_out=%dir% --plugin=protoc-gen-grpc=%pluginPath% bdledger/api/node.proto
call %exe% -I . --js_out=import_style=commonjs,binary:%dir% --grpc_out=%dir% --plugin=protoc-gen-grpc=%pluginPath% bdledger/api/ledger.proto
call %exe% -I . --js_out=import_style=commonjs,binary:%dir% --grpc_out=%dir% --plugin=protoc-gen-grpc=%pluginPath% bdledger/api/query.proto
2020-03-14 13:48:59 +00:00
echo all done