-
Notifications
You must be signed in to change notification settings - Fork 2
/
run.sh
executable file
·52 lines (42 loc) · 1 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
#!/bin/sh
if [ -e /opt/protostuffdb/bin/protostuffdb ]; then
BIN=/opt/protostuffdb/bin/protostuffdb
elif [ -e target/protostuffdb ]; then
BIN=./target/protostuffdb
else
echo 'The target/protostuffdb binary must exist' && exit 1
fi
DATA_DIR=target/data/main
JAR=todo-all/target/todo-all-jarjar.jar
ARGS=$(cat ARGS.txt)
PORT=$(cat PORT.txt)
jarjar() {
cd todo-all
rm -f target/*.jar
mvn -o -Pjwd -Djwd=compile -Dmaven.javadoc.skip=true compile
cd - > /dev/null
}
case "$1" in
0)
# recompile and skip run
rm -f $JAR
jarjar
exit 0
;;
1)
# recompile
rm -f $JAR
;;
*)
# regenerate and recompile module
[ "$1" != "" ] && [ -e "modules/$1" ] && \
./modules/codegen.sh $1 && \
cd modules/$1 && \
mvn -o -Dmaven.javadoc.skip=true install && \
cd - > /dev/null && \
rm -f $JAR
;;
esac
[ -e $JAR ] || jarjar
mkdir -p $DATA_DIR
$BIN $PORT todo-ts/g/user/UserServices.json $ARGS -Djava.class.path=$JAR todo.all.Main