forked from yixia/code_swarm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·62 lines (56 loc) · 1.92 KB
/
run.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
# run.sh : code_swarm launching script
# need the config file as first parameter
params=$@
default_config="data/sample.config"
code_swarm_jar="dist/code_swarm.jar"
# command line parameters basic check
if [ $# = 0 ]; then
# asking user for a config file
echo "code_swarm project !"
echo -n "Specify a config file, or ENTER for default one [$default_config] : "
read config
if [ ${#config} = 0 ]; then
params=$default_config
else
params=$config
fi
else
if [ $1 == "-h" ] || [ $1 == "--help" ]; then
# if help needed, print it and exit
echo "usage: run.sh <configfile>"
echo ""
echo " data/sample.config is the default config file"
echo ""
exit
else
echo "code_swarm project !"
fi
fi
# checking for code_swarm java binaries
if [ ! -f $code_swarm_jar ]; then
echo "no code_swarm binaries !"
echo "needing to build it with 'ant' and 'javac' (java-sdk)"
echo ""
echo "auto-trying the ant command..."
if ant; then
echo ""
else
echo ""
echo "ERROR, please verify 'ant' and 'java-sdk' installation"
echo -n "press a key to exit"
read key
echo "bye"
exit
fi
fi
# running
#if java -Xmx1000m -classpath dist/code_swarm.jar:lib/core.jar:lib/xml.jar:lib/vecmath.jar:. code_swarm $params; then
#if java -Xmx1000m -classpath dist/code_swarm.jar:lib/gluegen-rt.jar:lib/jogl.jar:lib/jogl-natives-macosx-universal.jar:lib/core.jar:lib/opengl.jar:lib/xml.jar:lib/vecmath.jar:. code_swarm $params; then
if java -Xmx1000m -classpath dist/code_swarm.jar:lib/gluegen-rt.jar:lib/jogl.jar:lib/jogl-natives-macosx-universal.jar:lib/core.jar:lib/opengl.jar:lib/xml.jar:lib/vecmath.jar:. -Djava.library.path=lib/ code_swarm $params; then
# always on error due to no "exit buton" on rendering window
echo "bye"
# echo -n "error, press a key to exit"
# read key
else
echo "bye"
fi