This repository has been archived by the owner on Aug 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path_build.sh
executable file
·100 lines (90 loc) · 1.93 KB
/
_build.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
89
90
91
92
93
94
95
96
97
98
#!/bin/bash
printf "===TTGen - BUILD===\n\n"
##########
# CONFIG #
##########
printf "\n===LOADING CONFIG===\n\n"
typeset -A config
config=(
[CLIENT_ID]=""
[CLIENT_SECRET]=""
[FACULTY]=""
[SEMESTER]=""
[COURSES]=""
[IGNORE_LECT]=""
[IGNORE_TUTS]=""
[IGNORE_LABS]=""
[NE_730]=""
[NE_915]=""
[BUILD]=""
[PORT]=""
)
while read line
do
if echo $line | grep -F = &>/dev/null
then
varname=$(echo "$line" | cut -d '=' -f 1)
config[$varname]=$(echo "$line" | cut -d '=' -f 2-)
fi
done < config.txt
DIR_BUILD=${config[BUILD]}
#########
# BUILD #
#########
HERE=$(pwd)
rm -rf "$DIR_BUILD"
mkdir "$DIR_BUILD"
# Build - LoadData
printf "\n===BUILDING - LoadData===\n\n"
DIR_LOADDATA="$DIR_BUILD/LoadData"
mkdir "$DIR_LOADDATA"
cp LoadData/main.py "$DIR_LOADDATA/main.py"
ret=$?
if [ $ret -ne 0 ]; then
printf "\n===ERROR: Building LoadData failed===\n\n"
echo "$DATA_LOAD"
exit 1
fi
# Build - ProcessData
printf "\n===BUILDING - ProcessData===\n\n"
DIR_PROCESSDATA="$DIR_BUILD/ProcessData"
mkdir "$DIR_PROCESSDATA"
cd "$DIR_PROCESSDATA"
cmake -DCMAKE_BUILD_TYPE=Release "$HERE/ProcessData"
ret=$?
if [ $ret -ne 0 ]; then
printf "\n===ERROR: Building ProcessData (CMake) failed===\n\n"
echo "$DATA_LOAD"
exit 1
fi
make
ret=$?
if [ $ret -ne 0 ]; then
printf "\n===ERROR: Building ProcessData (Make) failed===\n\n"
echo "$DATA_LOAD"
exit 1
fi
cd "$HERE"
# Build - Viewer
printf "\n===BUILDING - Viewer===\n\n"
DIR_VIEWER="$DIR_BUILD/Viewer"
mkdir "$DIR_VIEWER"
cp -r Viewer/* "$DIR_VIEWER"
cd "$DIR_VIEWER"
yarn install
ret=$?
if [ $ret -ne 0 ]; then
printf "\n===ERROR: Building Viewer (install) failed===\n\n"
echo "$DATA_LOAD"
exit 1
fi
yarn run build
ret=$?
if [ $ret -ne 0 ]; then
printf "\n===ERROR: Building Viewer (build) failed===\n\n"
echo "$DATA_LOAD"
exit 1
fi
cd "$HERE"
mkdir "$DIR_BUILD/run"
mv "$DIR_VIEWER/build"/* "$DIR_BUILD/run/"