forked from typetools/annotation-tools
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.build-without-test.sh
executable file
·32 lines (23 loc) · 1.04 KB
/
.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
#!/bin/bash
echo Entering "$(cd "$(dirname "$0")" && pwd -P)/$(basename "$0")" in "$(pwd)"
# Fail the whole script if any command fails
set -e
# Print commands as they are executed
set -x
export SHELLOPTS
if [ "$(uname)" = "Darwin" ] ; then
export JAVA_HOME=${JAVA_HOME:-$(/usr/libexec/java_home)}
else
export JAVA_HOME=${JAVA_HOME:-$(dirname "$(dirname "$(readlink -f "$(which javac)")")")}
fi
echo "JAVA_HOME=$JAVA_HOME"
export AFU="${AFU:-$(cd annotation-file-utilities && pwd -P)}"
export PATH=$AFU/scripts:$JAVA_HOME/bin:$PATH
## Download Gradle and its dependencies (retry in case of network lossage).
(cd "${AFU}" && \
TERM=dumb timeout 300 ./gradlew --write-verification-metadata sha256 help --dry-run </dev/null >/dev/null 2>&1 || \
TERM=dumb ./gradlew --write-verification-metadata sha256 help --dry-run </dev/null >/dev/null 2>&1 || \
(sleep 1m && ./gradlew --write-verification-metadata sha256 help --dry-run))
## Compile
(cd "${AFU}" && ./gradlew assemble)
echo Exiting "$(cd "$(dirname "$0")" && pwd -P)/$(basename "$0")" in "$(pwd)"