-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGenProtoCode.sh
executable file
·58 lines (50 loc) · 1.39 KB
/
GenProtoCode.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
# Author: i0gan
# Email : [email protected]
# Date : 2022-10-01
# Github: https://github.com/pwnsky/squick
# Description: Install development environment on linux
cd $(dirname $0)
source ../tools/common.sh
export LD_LIBRARY_PATH=`realpath ../third_party/build/bin`:`realpath ../third_party/build/lib`:`realpath ../third_party/build/protobuf`
echo $LD_LIBRARY_PATH
proto_bin='../third_party/build/bin/protoc'
proto_path="./Proto"
cpp_out_path="./ProtoCode/Cpp"
csharp_out_path='./ProtoCode/Csharp'
python_out_path='./ProtoCode/Python'
lua_out_path="./ProtoCode/Lua"
mkdir -p $csharp_out_path
mkdir -p $python_out_path
mkdir -p $lua_out_path
mkdir -p $cpp_out_path
# 生成Lua文件
cd Tools/proto
python3 gen_msgid.py
check_err
python3 proto_enum_to_lua.py
check_err
python3 proto_to_lua_str.py
check_err
cd ../..
proto_files=$proto_path/*.proto
for f in $proto_files
do
echo $f
$proto_bin --cpp_out=$cpp_out_path --proto_path=$proto_path $f
check_err
$proto_bin --csharp_out=$csharp_out_path --proto_path=$proto_path $f
check_err
$proto_bin --python_out=$python_out_path --proto_path=$proto_path $f
check_err
done
# remove nodes rpc files
rm $csharp_out_path/N*.cs
mkdir -p Tools/pycli/proto
cp $python_out_path/* Tools/pycli/proto
check_err
# copy for server
cp $cpp_out_path/* ../src/struct
check_err
cp $lua_out_path/enum_all.lua ../src/lua/proto/enum.lua
check_err