Initial commit
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
@echo off
|
||||
|
||||
:: Install golang protoc plugin with follow command first
|
||||
::
|
||||
:: go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
|
||||
:: go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
|
||||
::
|
||||
|
||||
set CURRENT_DIR=%CD%
|
||||
|
||||
pushd ..\..\Client\Plugins\TurboLink
|
||||
set TL_UE_PLUGIN_PATH=%CD%
|
||||
popd
|
||||
|
||||
set PROTOC_EXE_PATH=%TL_UE_PLUGIN_PATH%\ThirdParty\protobuf\bin\protoc.exe
|
||||
|
||||
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: generate client code
|
||||
set CLIENT_OUTPUT_DIR=%CURRENT_DIR%\output\client
|
||||
if not exist %CLIENT_OUTPUT_DIR% mkdir %CLIENT_OUTPUT_DIR%
|
||||
|
||||
call "%TL_UE_PLUGIN_PATH%\Tools\generate_code.cmd" hello.proto Greeter %CLIENT_OUTPUT_DIR%
|
||||
call "%TL_UE_PLUGIN_PATH%\Tools\generate_code.cmd" user.proto User %CLIENT_OUTPUT_DIR%
|
||||
|
||||
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: generate server code
|
||||
set SERVER_OUTPUT_DIR=%CURRENT_DIR%\output\server
|
||||
if not exist %SERVER_OUTPUT_DIR% mkdir %SERVER_OUTPUT_DIR%
|
||||
|
||||
"%PROTOC_EXE_PATH%" --go_out="%SERVER_OUTPUT_DIR%" --go-grpc_out=%SERVER_OUTPUT_DIR% hello.proto
|
||||
"%PROTOC_EXE_PATH%" --go_out="%SERVER_OUTPUT_DIR%" --go-grpc_out=%SERVER_OUTPUT_DIR% user.proto
|
||||
|
||||
Reference in New Issue
Block a user