This repository has been archived by the owner on Feb 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build-client.sh
80 lines (65 loc) · 1.51 KB
/
build-client.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/sh
SRC_JAVA=./src
BUILD=$(pwd)/target
LIB=$(pwd)/target/dependency
CLASSES=$BUILD/classes:$BUILD/generated-code/resources
BIN=$(pwd)/bin
RETVAL=0
prog="build.sh"
###################################################################
build() {
mvn install -Pmessaging -Dmaven.test.skip=true
mvn dependency:copy-dependencies
mkdir -p bin
for i in $(ls $LIB |grep ".jar"); do
CLASSES=$CLASSES:$LIB/$i
done
for i in $(ls $BUILD |grep ".jar"); do
CLASSES=$CLASSES:$BUILD/$i
done
echo "
#!/bin/sh
CLASSES=$CLASSES
" > ./bin/MatchmakerClient.sh
echo '
if [ "$3" = "" ];
then
echo
echo "#########################################"
echo "# MatchmakerClient.sh #"
echo "#########################################"
echo
echo "$ MatchmakerClient.sh <sync/async> <properties file> <input file>"
echo
exit 1
fi
CP=:$CLASSPATH:$CLASSES:.
if [ "$1" = "sync" ];
then
mainClass=edu.indiana.d2i.matchmaker.client.SynchronizedClient
else
mainClass=edu.indiana.d2i.matchmaker.client.AsynchronizedClient
fi
java -classpath $CP $mainClass $2 $3
' >> ./bin/MatchmakerClient.sh
chmod 755 ./bin/MatchmakerClient.sh
return $RETVAL
}
###################################################################
clean(){
rm -rf $BIN
mvn clean
return $RETVAL
}
###################################################################
case "$1" in
clean)
clean
;;
*)
#clean
build
RETVAL=$?
;;
esac
exit $RETVAL