forked from hazelcast/hazelcast-jet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate_client_protocol.sh
executable file
·41 lines (29 loc) · 1.03 KB
/
generate_client_protocol.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
#!/usr/bin/env bash
SCRIPT_DIR="$(dirname "$0")"
JET_HOME="$(cd "$SCRIPT_DIR/"; pwd)"
PYTHON="$(which python3 2>/dev/null)"
PIP3="$(which pip3 2>/dev/null)"
GIT="$(which git 2>/dev/null)"
PROTOCOL_DIRECTORY=`mktemp -d 2>/dev/null || mktemp -d -t 'protocol'`
if [ -z "$PYTHON" ]; then
echo "Python 3 could not be found in your system."
exit 1
fi
if [ -z "$PIP3" ]; then
echo "PIP 3 could not be found in your system."
exit 1
fi
if [ -z "$GIT" ]; then
echo "Git could not be found in your system."
exit 1
fi
echo $SCRIPT_DIR
echo $JET_HOME
echo $PROTOCOL_DIRECTORY
$GIT clone --depth=1 https://github.com/hazelcast/hazelcast-client-protocol.git $PROTOCOL_DIRECTORY
cd $PROTOCOL_DIRECTORY
$PIP3 install -r requirements.txt
$PYTHON generator.py -r $JET_HOME -p $JET_HOME/hazelcast-jet-core/src/main/resources/client-protocol-definition \
-o hazelcast-jet-core/src/main/java/com/hazelcast/jet/impl/client/protocol/codec \
-n com.hazelcast.jet.impl.client.protocol.codec --no-binary --no-id-check
rm -rf $PROTOCOL_DIRECTORY