-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathcompile.sh
63 lines (58 loc) · 1.49 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
#!/bin/bash
# Counting given arguments
if [[ $# > 1 ]];
then
echo "Too many arguments..."
echo " To compile: >bash compile.sh"
echo " To clean: >bash compile.sh clean"
exit 1
fi
# Simple switch to remove compiled files...
case "$1" in
"clean" )
echo "Cleaning the project."
cd $(dirname $0)
rm src/load-src/build.sbt
rm -rf bin/sparqlgx-load.jar bin/sparqlgx-translator
rm -rf src/load-src/project/ src/load-src/target/
cd src/translation-src/
make clean
cd ../../
exit 0
;;
"" )
# Skip and compile :)
;;
* )
echo "Usage:"
echo " To compile >bash compile.sh"
echo " To clean >bash compile.sh clean"
exit 1
;;
esac
start_time=$(date +%s)
cd $(dirname $0) # Execution from correct location.
echo "====== SPARQLGX compilation chain ======"
echo "---- Generation of build.sbt ----"
bash bin/generate-build.sh "SPARQLGX Load" > src/load-src/build.sbt
echo "build.sbt in src/load-src/"
echo "---- Load Source Compilation ----"
cd src/load-src/
sbt package
cp target/scala*/sparqlgx* ../../bin/sparqlgx-load.jar
cd ../../
echo "---- Translation Source Compilation ----"
cd src/translation-src/
make
chmod +x sparql2scala
cp sparql2scala ../../bin/sparqlgx-translator
cd ../../
echo "========================================"
echo ""
stop_time=$(date +%s)
echo "The compilation process took $(($stop_time-$start_time)) seconds."
echo ""
echo "Before using SPARQLGX, make sure that:"
echo " 1. The conf file in conf/ is correct"
echo " 2. alias bin/sparqlgx.sh"
exit 0