forked from typetools/annotation-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis-build.sh
executable file
·80 lines (59 loc) · 2.49 KB
/
.travis-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
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/bash
echo Entering `pwd`/.travis-build.sh, GROUP=$1
# Optional argument $1 is one of:
# all, test, misc, downstream
# It defaults to "all".
export GROUP=$1
if [[ "${GROUP}" == "" ]]; then
export GROUP=all
fi
if [[ "${GROUP}" != "all" && "${GROUP}" != "test" && "${GROUP}" != "misc" && "${GROUP}" != "downstream" ]]; then
echo "Bad argument '${GROUP}'; should be omitted or one of: all, test, misc, downstream."
exit 1
fi
# Fail the whole script if any command fails
set -e
## Diagnostic output
# Output lines of this script as they are read.
set -o verbose
# Output expanded lines of this script as they are executed.
set -o xtrace
# Don't use "-d" to debug ant, because that results in a log so long
# that Travis truncates the log and terminates the job.
export SHELLOPTS
SLUGOWNER=${TRAVIS_PULL_REQUEST_SLUG%/*}
if [[ "$SLUGOWNER" == "" ]]; then
SLUGOWNER=${TRAVIS_REPO_SLUG%/*}
fi
if [[ "$SLUGOWNER" == "" ]]; then
SLUGOWNER=typetools
fi
echo SLUGOWNER=$SLUGOWNER
./.travis-build-without-test.sh
set -e
if [[ "${GROUP}" == "test" || "${GROUP}" == "all" ]]; then
ant test
fi
if [[ "${GROUP}" == "misc" || "${GROUP}" == "all" ]]; then
## jdkany tests: miscellaneous tests that shouldn't depend on JDK version.
set -e
ant check-style
# TODO: when codebase is reformatted (after merging branches?)
# ant check-format
ant html-validate
ant javadoc
fi
if [[ "${GROUP}" == "downstream" || "${GROUP}" == "all" ]]; then
# checker-framework and its downstream tests
(cd .. && git clone --depth 1 https://github.com/plume-lib/plume-scripts.git)
REPO=`../plume-scripts/git-find-fork ${SLUGOWNER} typetools checker-framework`
BRANCH=`../plume-scripts/git-find-branch ${REPO} ${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}`
(cd .. && git clone -b ${BRANCH} --single-branch --depth 1 ${REPO}) || (cd .. && git clone -b ${BRANCH} --single-branch --depth 1 ${REPO})
REPO=`../plume-scripts/git-find-fork ${SLUGOWNER} typetools checker-framework-inference`
BRANCH=`../plume-scripts/git-find-branch ${REPO} ${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}`
(cd .. && git clone -b ${BRANCH} --single-branch --depth 1 ${REPO}) || (cd .. && git clone -b ${BRANCH} --single-branch --depth 1 ${REPO})
(cd ../checker-framework-inference && . ./.travis-build-without-test.sh)
(cd ../checker-framework/framework && ../gradlew wholeProgramInferenceTests)
(cd ../checker-framework-inference && ./gradlew dist && ./gradlew test)
fi
echo Exiting `pwd`/.travis-build.sh, GROUP=$1