-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildall.sh
47 lines (38 loc) · 836 Bytes
/
buildall.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
#!/bin/sh
JAVAC_CMD="${JAVA_HOME:+${JAVA_HOME}/bin/}javac"
SOURCES_DIR=src
BUILDENUM_CP=lib/buildenumerator.jar
echo "javac command: ${JAVAC_CMD}"
error() {
decrement_buildnumber
echo "There were errors..."
}
jobCompleted() {
echo "Done!"
}
increment_buildnumber() {
echo "Incrementing build number..."
java -cp $BUILDENUM_CP BuildEnumerator $SOURCES_DIR/org/catacombae/hfsexplorer/BuildNumber.java 1
}
decrement_buildnumber() {
echo "Decrementing build number..."
java -cp $BUILDENUM_CP BuildEnumerator $SOURCES_DIR/org/catacombae/hfsexplorer/BuildNumber.java -1
}
antbuild() {
echo "Building with ant..."
ant build-all
return $?
}
main() {
increment_buildnumber
antbuild
if [ "$?" -eq 0 ]; then
jobCompleted
return 0
else
error
return -1
fi
}
#entry point
main