-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathgen_msg.sh
More file actions
executable file
·48 lines (39 loc) · 986 Bytes
/
gen_msg.sh
File metadata and controls
executable file
·48 lines (39 loc) · 986 Bytes
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
#! /bin/bash
DEFINE_PATH='../config/structs/'
SERVER_PATH='../misc/'
CPP_TARGET='../msg'
JS_TARGET='../js'
ROBOT_PATH='../../robot/msg'
function gen_msg(){
gen_cpp
gen_js
gen_msgd
cp_file
do_some_others
}
function gen_cpp(){
./struct_tool cpp $DEFINE_PATH 'game_struct.xml' 'Game_Struct'
./struct_tool cpp $DEFINE_PATH 'outer_msg.xml' 'Client_Message'
./struct_tool cpp $DEFINE_PATH 'inner_msg.xml' 'Server_Message'
}
function gen_js(){
./struct_tool js $DEFINE_PATH 'game_struct.xml' 'struct'
./struct_tool js $DEFINE_PATH 'inner_msg.xml' 'struct'
./struct_tool js $DEFINE_PATH 'outer_msg.xml' 'struct'
}
function gen_msgd(){
./struct_tool msg $DEFINE_PATH 'Message.define' 'msg'
}
function cp_file(){
wildcard='.*'
cp -rf CPP/* $CPP_TARGET
cp -rf CPP/'Client_Message'${wildcard} $ROBOT_PATH
cp -rf CPP/'Game_Struct'${wildcard} $ROBOT_PATH
cp -rf CPP/Message.h $ROBOT_PATH
cp -rf JS/* $JS_TARGET
}
function do_some_others(){
rm -rf CPP
rm -rf JS
}
gen_msg