forked from typetools/checker-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis-build.sh
executable file
·97 lines (73 loc) · 3.02 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/bash
echo "Entering $0, GROUP=$1"
# Optional argument $1 is one of:
# all, framework-tests, all-tests, jdk.jar, misc, checker-framework-inference, plume-lib, downstream
# It defaults to "all".
export GROUP=$1
if [[ "${GROUP}" == "" ]]; then
export GROUP=all
fi
if [[ "${GROUP}" != "all" && "${GROUP}" != "framework-tests" && "${GROUP}" != "all-tests" && "${GROUP}" != "jdk.jar" && "${GROUP}" != "checker-framework-inference" && "${GROUP}" != "downstream" && "${GROUP}" != "misc" && "${GROUP}" != "plume-lib" ]]; then
echo "Bad argument '${GROUP}'; should be omitted or one of: all, framework-tests, all-tests, jdk.jar, checker-framework-inference, downstream, misc, plume-lib."
exit 1
fi
# Optional argument $2 is one of:
# downloadjdk, buildjdk
# If it is omitted, this script uses downloadjdk.
export BUILDJDK=$2
if [[ "${BUILDJDK}" == "" ]]; then
export BUILDJDK=buildjdk
fi
if [[ "${BUILDJDK}" != "buildjdk" && "${BUILDJDK}" != "downloadjdk" ]]; then
echo "Bad argument '${BUILDJDK}'; should be omitted or one of: downloadjdk, buildjdk."
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
export SHELLOPTS
git -C /tmp/plume-scripts pull > /dev/null 2>&1 \
|| git -C /tmp clone --depth 1 -q https://github.com/plume-lib/plume-scripts.git
# For debugging
/tmp/plume-scripts/ci-info typetools
eval `/tmp/plume-scripts/ci-info typetools`
export CHECKERFRAMEWORK=`readlink -f ${CHECKERFRAMEWORK:-.}`
echo "CHECKERFRAMEWORK=$CHECKERFRAMEWORK"
ROOTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SCRIPTDIR=$ROOTDIR/checker/bin-devel/
source $SCRIPTDIR/build.sh ${BUILDJDK}
# The above command builds or downloads the JDK, so there is no need for a
# subsequent command to build it except to test building it.
set -e
echo "In checker-framework/.travis-build.sh GROUP=$GROUP"
### TESTS OF THIS REPOSITORY
if [[ "${GROUP}" == "framework-tests" || "${GROUP}" == "all" ]]; then
# These are tests that should pass without an annotated jdk. They are also run by all-tests.
# Once we have an annotataed jdk for 11 to test, this set of tests can be removed.
# TODO: These aren't being run by Azure.
./gradlew framework:test framework:jtreg --console=plain --warning-mode=all -s --no-daemon
fi
if [[ "${GROUP}" == "all-tests" || "${GROUP}" == "all" ]]; then
$SCRIPTDIR/test-all-tests.sh
fi
if [[ "${GROUP}" == "jdk.jar" || "${GROUP}" == "all" ]]; then
$SCRIPTDIR/test-jdk-jar.sh
fi
if [[ "${GROUP}" == "misc" || "${GROUP}" == "all" ]]; then
$SCRIPTDIR/test-misc.sh
fi
### TESTS OF DOWNSTREAM REPOSITORIES
if [[ "${GROUP}" == "checker-framework-inference" || "${GROUP}" == "all" ]]; then
$SCRIPTDIR/test-cf-inference.sh
fi
if [[ "${GROUP}" == "plume-lib" || "${GROUP}" == "all" ]]; then
$SCRIPTDIR/test-plume-lib.sh
fi
if [[ "${GROUP}" == "downstream" || "${GROUP}" == "all" ]]; then
$SCRIPTDIR/test-downstream.sh
fi
echo "Exiting $0, GROUP=$1"