-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.sh
executable file
·45 lines (34 loc) · 1.39 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
#!/usr/bin/env bash
# Setup the environment first.
echo "Begin to setup the environment..."
WORKING_DIR=`pwd`
CLASSPATH="$WORKING_DIR:$WORKING_DIR/classes:$WORKING_DIR/lib/CUP:$WORKING_DIR/lib/JLEX:."
COMPONENT="$WORKING_DIR"
export CLASSPATH
export COMPONENT
echo "Query environment setup successfully!"
# Begin to compile the project.
echo "Begin to build the project..."
# Creates the compilation output directory if not exists.
mkdir -p ${COMPONENT}/classes
javac -d ${COMPONENT}/classes ${COMPONENT}/src/qp/utils/*.java
javac -d ${COMPONENT}/classes ${COMPONENT}/src/qp/parser/*.java
javac -d ${COMPONENT}/classes ${COMPONENT}/src/qp/operators/*.java
javac -d ${COMPONENT}/classes ${COMPONENT}/src/qp/optimizer/*.java
javac -d ${COMPONENT}/classes ${COMPONENT}/testcases/*.java
javac -d ${COMPONENT}/classes ${COMPONENT}/src/QueryMain.java
echo "Project has been built successfully!"
echo "Begin to prepare fixtures for test cases"
cd classes/
for file in *.det; do
tableName=${file%.det}
echo "Generates fixtures for table named ${tableName}:"
if [[ -e ${tableName}.md && -e ${tableName}.stat && -e ${tableName}.tbl && -e ${tableName}.txt ]]; then
echo "Fixtures for table ${tableName} already exists!"
continue
fi
java RandomDB ${tableName} 10000
java ConvertTxtToTbl ${tableName}
echo ""
done
echo "Fixtures for test cases have been generated successfully!"