forked from typetools/checker-framework
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis-build-without-test.sh
executable file
·92 lines (78 loc) · 3.28 KB
/
.travis-build-without-test.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
#!/bin/bash
# Fail the whole script if any command fails
set -e
# Optional argument $1 is one of:
# downloadjdk, buildjdk
# If it is omitted, this script uses buildjdk.
export BUILDJDK=$1
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
export SHELLOPTS
SLUGOWNER=${TRAVIS_REPO_SLUG%/*}
if [[ "$SLUGOWNER" == "" ]]; then
SLUGOWNER=typetools
fi
# Checks for the existence of a repository
export GITEXISTS="wget -q --spider"
## Build annotation-tools (Annotation File Utilities)
if [ -d ../annotation-tools ] ; then
# Older versions of git don't support the -C command-line option
echo "Running: (cd ../annotation-tools && git pull)"
(cd ../annotation-tools && git pull)
echo "... done: (cd ../annotation-tools && git pull)"
else
set +e
echo "Running: ${GITEXISTS} https://github.com/${SLUGOWNER}/annotation-tools.git &>-"
${GITEXISTS} https://github.com/${SLUGOWNER}/annotation-tools.git &>-
if [ "$?" -ne 0 ]; then
ATSLUGOWNER=typetools
else
ATSLUGOWNER=${SLUGOWNER}
fi
set -e
echo "Running: (cd .. && git clone --depth 1 https://github.com/${ATSLUGOWNER}/annotation-tools.git)"
(cd .. && git clone --depth 1 https://github.com/${ATSLUGOWNER}/annotation-tools.git) || (cd .. && git clone --depth 1 https://github.com/${ATSLUGOWNER}/annotation-tools.git)
echo "... done: (cd .. && git clone --depth 1 https://github.com/${ATSLUGOWNER}/annotation-tools.git)"
fi
# This also builds jsr308-langtools
echo "Running: (cd ../annotation-tools/ && ./.travis-build-without-test.sh)"
(cd ../annotation-tools/ && ./.travis-build-without-test.sh)
echo "... done: (cd ../annotation-tools/ && ./.travis-build-without-test.sh)"
## Build stubparser
if [ -d ../stubparser ] ; then
# Older versions of git don't support the -C command-line option
echo "Running: (cd ../stubparser && git pull)"
(cd ../stubparser && git pull)
echo "... done: (cd ../stubparser && git pull)"
else
set +e
echo "Running: ${GITEXISTS} https://github.com/${SLUGOWNER}/stubparser.git &>-"
${GITEXISTS} https://github.com/${SLUGOWNER}/stubparser.git &>-
if [ "$?" -ne 0 ]; then
SPSLUGOWNER=typetools
else
SPSLUGOWNER=${SLUGOWNER}
fi
set -e
echo "Running: (cd .. && git clone --depth 1 https://github.com/${SPSLUGOWNER}/stubparser.git)"
(cd .. && git clone --depth 1 https://github.com/${SPSLUGOWNER}/stubparser.git) || (cd .. && git clone --depth 1 https://github.com/${SPSLUGOWNER}/stubparser.git)
echo "... done: (cd .. && git clone --depth 1 https://github.com/${SPSLUGOWNER}/stubparser.git)"
fi
echo "Running: (cd ../stubparser/ && ./.travis-build-without-test.sh)"
(cd ../stubparser/ && ./.travis-build-without-test.sh)
echo "... done: (cd ../stubparser/ && ./.travis-build-without-test.sh)"
## Compile
# Two options: rebuild the JDK or download a prebuilt JDK.
if [[ "${BUILDJDK}" == "buildjdk" ]]; then
echo "running \"./gradlew assemble buildJdk\" for checker-framework"
./gradlew assemble buildJdk
fi
if [[ "${BUILDJDK}" == "downloadjdk" ]]; then
echo "running \"./gradlew assemble\" for checker-framework"
./gradlew assemble
fi