-
Notifications
You must be signed in to change notification settings - Fork 4
/
compile.sh
executable file
·67 lines (62 loc) · 1.34 KB
/
compile.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
61
62
63
64
65
66
67
#!/bin/bash
set -e
compile=1
imports=1
javadoc=1
builddir="./build"
docdir="./javadoc"
while [ -n "$1" ]
do
case $1 in
-h|--help)
echo "Available options are:"
echo " -c --skip-compile Skip code compilation"
echo " -i --skip-imports Skip imports checking"
echo " -j --skip-javadoc Skip generating documentation"
echo " -b --build-dir Directory for compilation [./build ]"
echo " -d --doc-dir Directory for javadoc [./javadoc]"
exit 0
;;
-c|--skip-compile)
compile=0
;;
-i|--skip-imports)
imports=0
;;
-j|--skip-javadoc)
javadoc=0
;;
-b|--build-dir)
builddir="$2"
shift
;;
-d|--doc-dir)
docdir="$2"
shift
;;
*)
echo "Unknown option: $1"
echo "Use -h or --help for list of available options"
exit 1
esac
shift
done
if [ $compile -ge 1 ]
then
echo "Compiling..."
rm -r "$builddir" || true
mkdir "$builddir"
javac -cp ./json-simple-1.1.1.jar:. -encoding UTF8 -d "$builddir" wl/*/*.java
fi
if [ $imports -ge 1 ]
then
echo "Checking includes..."
./check_includes.sh
fi
if [ $javadoc -ge 1 ]
then
echo "Generating javadoc..."
rm -r "$docdir" || true
mkdir "$docdir"
javadoc -cp ./json-simple-1.1.1.jar:. -encoding UTF8 -quiet -d "$docdir" wl.utils wl.server
fi