summaryrefslogtreecommitdiff
path: root/run.sh
diff options
context:
space:
mode:
authorMaurice Laveaux <m.laveaux@student.tue.nl>2014-05-15 15:35:56 +0200
committerMaurice Laveaux <m.laveaux@student.tue.nl>2014-05-15 15:35:56 +0200
commit014e93b9bb9c9957aa6ea28053833bc7a700cfee (patch)
tree549f2244648443ba865b9b6cc194d7b972d8bbd6 /run.sh
parentf7bbf62d33774b200972549afaf05240565fc2d3 (diff)
downloadGoldfarmer-014e93b9bb9c9957aa6ea28053833bc7a700cfee.tar.gz
Added the run.sh shell script from Datafiller.
Diffstat (limited to 'run.sh')
-rwxr-xr-xrun.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/run.sh b/run.sh
new file mode 100755
index 0000000..d6bc225
--- /dev/null
+++ b/run.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+# You should build the jar file with `ant jar`, then run this script
+
+# Exit on errors
+set -e
+
+# Change dir to project
+cd "$(dirname "$(readlink -f "$0")")"
+
+# java jar is slower. Also note that netbeans might already have built the
+# classes so `ant compile` will be faster.
+ant -q compile
+java -cp build/classes:$(echo lib/*.jar | tr \ :) main.Main "$@"
+exit # Do not build jar
+
+jar=dist/Datafiller.jar
+# Build jar if missing
+[ -e "$jar" ] || ant jar
+
+java -jar "$jar" "$@"