-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake.sh
More file actions
executable file
·77 lines (62 loc) · 1.79 KB
/
make.sh
File metadata and controls
executable file
·77 lines (62 loc) · 1.79 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/env bash
#
# Lorenz Leutgeb <e1127842@student.tuwien.ac.at>
#
echo USAGE OF THIS SCRIPT IS DEPRECATED
#JAVAC=$(whereis javac)
JAVAC="/usr/java/jdk1.7.0_05/bin/javac"
# directory where user-code and -classes are stored
PLAYERS=/home/lorenz/Dropbox/gamboo/java/players
# directory where framework sources (gamboo.*) is stored.
GAMBOO=/home/lorenz/Dropbox/gamboo/java
GAMES=/home/lorenz/Dropbox/gamboo/java/games
# libraries
LIBS=$(ls -1 $GAMBOO/lib/*.jar | tr "\n" ":")$(ls -1 $GAMES/*.jar | tr "\n" ":")$GAMBOO/gamboo.jar
# compilerflags for javac
FLAGS="-g -Xlint:unchecked -Xlint:deprecation -cp $LIBS"
#FLAGS="$FLAGS -Werror"
function log {
echo -e "$(basename $0): $1"
}
clear
for i in $@ ; do
if [ "$i" -eq "$i" -a -e $PLAYERS/$i ] 2> /dev/null ; then
mkdir $PLAYERS/$i/tmp
find $PLAYERS/$i/src -name *.java -exec $JAVAC -d $PLAYERS/$i/tmp $FLAGS -processor gamboo.annotation.ServiceProcessor {} +
if [ $? -ne 0 ] ; then
log "[$i/javac] failed"
fi
if [ -e $PLAYERS/$i.jar ] ; then
log "[$i/jar] update"
jar uf $PLAYERS/$i.jar -C $PLAYERS/$i/tmp .
else
log "[$i/jar] create"
jar cf $PLAYERS/$i.jar -C $PLAYERS/$i/tmp .
fi
if [ $? -ne 0 ] ; then
log "[$i/jar] failed"
fi
rm -rf $PLAYERS/$i/tmp
log "[$i] ok"
elif [ -e $GAMES/$i/ ] ; then
mkdir $GAMES/$i/tmp
find $GAMES/$i -name *.java -exec $JAVAC -d $GAMES/$i/tmp $FLAGS -sourcepath /tmp/ -processor gamboo.annotation.ServiceProcessor {} +
if [ $? -ne 0 ] ; then
log "[$i/javac] failed"
fi
if [ -e $GAMES/$i.jar ] ; then
log "[$i/jar] update"
jar uf $GAMES/$i.jar -C $GAMES/$i/tmp .
else
log "[$i/jar] create"
jar cf $GAMES/$i.jar -C $GAMES/$i/tmp .
fi
if [ $? -ne 0 ] ; then
log "[$i/jar] failed"
fi
rm -rf $GAMES/$i/tmp
log "[$i] ok"
else
log "[$i] skip"
fi
done