forked from cosbi-research/QSPcc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compile.sh
executable file
·88 lines (76 loc) · 2.11 KB
/
compile.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
80
81
82
83
84
85
86
87
88
#!/bin/bash
PROGRAM_NAME="QSPcc"
DIST_FOLDER="dist"
TEST_PROGRAM_NAME="QSPccTests"
FRONTEND_FOLDER="frontends"
BACKEND_FOLDER="backends"
MIDDLEEND_FOLDER="middleend"
SDK_FOLDER="SDK"
mkdir -p $DIST_FOLDER
cd $SDK_FOLDER
echo "-------------------- BUILDING SDK -------------------"
ant
rc=$?
if [[ $rc != 0 ]]; then
echo "FAILED TO BUILD SDK"
exit $rc
fi
cd -
# needed to compile
cp $SDK_FOLDER/build/jar/SDK.jar lib
# store in distribution folder
cp $SDK_FOLDER/build/jar/SDK.jar $DIST_FOLDER
echo "------------------ BUILDING MIDDLE-END --------------"
cp $SDK_FOLDER/build/jar/SDK.jar $MIDDLEEND_FOLDER/lib
cd $MIDDLEEND_FOLDER
ant
rc=$?
cd -
if [[ $rc != 0 ]]; then
echo "FAILED TO BUILD MIDDLE-END"
exit $rc
fi
cp $MIDDLEEND_FOLDER/build/jar/MiddleEnd.jar $DIST_FOLDER
echo "------------------ BUILDING FRONTENDS --------------"
for frontend in $(ls -1 $FRONTEND_FOLDER); do
echo "----------- BUILDING $frontend -------------"
cp $SDK_FOLDER/build/jar/SDK.jar $FRONTEND_FOLDER/$frontend/lib
cd $FRONTEND_FOLDER/$frontend
ant
rc=$?
cd -
if [[ $rc != 0 ]]; then
echo "FAILED TO BUILD $frontend"
continue
fi
# store in distribution folder
cp $FRONTEND_FOLDER/$frontend/build/jar/$frontend.jar $DIST_FOLDER
done
echo "------------------ BUILDING BACKENDS --------------"
for backend in $(ls -1 $BACKEND_FOLDER); do
echo "----------- BUILDING $backend -------------"
cp $SDK_FOLDER/build/jar/SDK.jar $BACKEND_FOLDER/$backend/lib
cd $BACKEND_FOLDER/$backend
ant
rc=$?
cd -
if [[ $rc != 0 ]]; then
echo "FAILED TO BUILD $backend"
continue
fi
# store in distribution folder
cp $BACKEND_FOLDER/$backend/build/jar/$backend.jar $DIST_FOLDER
done
echo "-------------------- BUILDING LANGUAGE TRANSLATOR -------------------"
ant
rc=$?
if [[ $rc != 0 ]]; then
echo "FAILED TO BUILD LANGUAGE TRANSLATOR"
exit $rc
fi
# store in distribution folder
cp build/jar/$PROGRAM_NAME.jar $DIST_FOLDER
# store in distribution folder
cp build/jar/$TEST_PROGRAM_NAME.jar $DIST_FOLDER
# cleanup
rm lib/SDK.jar