forked from typetools/checker-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis-build-without-test.sh
executable file
·89 lines (76 loc) · 3.19 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
#!/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
## 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: git ls-remote https://github.com/${SLUGOWNER}/annotation-tools.git &>-"
git ls-remote 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: git ls-remote https://github.com/${SLUGOWNER}/stubparser.git &>-"
git ls-remote 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 \"ant dist\" for checker-framework"
ant dist
fi
if [[ "${BUILDJDK}" == "downloadjdk" ]]; then
echo "running \"ant dist-downloadjdk\" for checker-framework"
(cd checker && ant dist-downloadjdk)
fi