-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sh
executable file
·67 lines (55 loc) · 2.62 KB
/
build.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
# Required argument $1 is one of:
# all, formatter, index, interning, lock, nullness, regex, signature, nothing
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# Fail the whole script if any command fails
set -e
# ## Short version, intended to be used when triggering downstream Travis jobs.
# echo "Should next trigger downstream jobs."
# exit 0
export JAVA_HOME=${JAVA_HOME:-`which javac|xargs readlink -f|xargs dirname|xargs dirname`}
BRANCH=master
## Build Checker Framework
(cd $ROOT && git clone --filter=blob:none --branch $BRANCH https://github.com/typetools/checker-framework.git) || (cd $ROOT && git clone --filter=blob:none --branch $BRANCH https://github.com/typetools/checker-framework.git)
# This also builds annotation-tools
(cd $ROOT/checker-framework/ && ./.travis-build-without-test.sh downloadjdk)
export CHECKERFRAMEWORK=$ROOT/checker-framework
## Obtain daikon
(cd $ROOT && git clone --filter=blob:none https://github.com/codespecs/daikon.git) || (cd $ROOT && git clone --filter=blob:none https://github.com/codespecs/daikon.git)
make -C $ROOT/daikon/java compile
make -C $ROOT/daikon daikon.jar
echo ""
(cd $CHECKERFRAMEWORK && echo "Checker Framework version:" && git rev-parse HEAD && git log --oneline --format=%B -n 1 HEAD | head -n 1)
(cd $ROOT/daikon && echo "Daikon version:" && git rev-parse HEAD && git log --oneline --format=%B -n 1 HEAD | head -n 1)
echo ""
## It would be better to just run "make check-all", but that times out, so break
## it into different Travis jobs. That also helps to indicate the specific
## error that occurred.
## make -C $ROOT/daikon/java check-all
# As of July 2016, the "nothing" group takes 15 minutes, on Travis, and all
# the others take between 20 and 25 minutes, except nullness which takes
# 85 minutes. This indicates that typechecking itself takes 5-10 minutes
# for all but one type system. So, I could probably fit them into fewer
# jobs if I want.
if [[ "$1" == "all" ]]; then
make -C $ROOT/daikon/java check-all
elif [[ "$1" == "formatter" ]]; then
make -C $ROOT/daikon/java check-formatter
elif [[ "$1" == "index" ]]; then
make -C $ROOT/daikon/java check-index
elif [[ "$1" == "interning" ]]; then
make -C $ROOT/daikon/java check-interning
elif [[ "$1" == "lock" ]]; then
make -C $ROOT/daikon/java check-lock
elif [[ "$1" == "nullness" ]]; then
make -C $ROOT/daikon/java check-nullness
elif [[ "$1" == "regex" ]]; then
make -C $ROOT/daikon/java check-regex
elif [[ "$1" == "signature" ]]; then
make -C $ROOT/daikon/java check-signature
elif [[ "$1" == "nothing" ]]; then
true
else
echo "Bad argument '$1' to travis-build.sh"
false
fi