-
Notifications
You must be signed in to change notification settings - Fork 1
/
run
executable file
·31 lines (26 loc) · 820 Bytes
/
run
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
#!/bin/bash
set -e
mainClass='si.gto76.basketstats.BasketStats'
appName='basket-stats'
scriptName=`basename $0`
echo "$scriptName: GETTING VERSION NUMBER..."
git describe > version
if [ $? -eq 0 ]; then
appName="$appName"-`git describe | sed -r 's/^[^0-9]([0-9\.]*).*$/\1/'`
fi
echo "$scriptName: COMPILING..."
mkdir -p target/main
javac -d target/main -cp `echo lib/*.jar | sed 's/ /:/'` `find src/main -name *.java`
cd target
mkdir -p lib
cd lib
echo "$scriptName: EXTRACTING LIBRARIES..."
for library in `find ../../lib/ -name *.jar &> /dev/null`; do
jar xf "$library";
done
cd ..
echo "$scriptName: PACKAGING IN JAR..."
jar cvfe "$appName.jar" "$mainClass" -C .. version -C ../src/main/resources . -C main . -C lib . &> /dev/null
echo "$scriptName: EXECUTING JAR..."
java -jar "$appName.jar"
rm ../version