forked from eclipse-collections/eclipse-collections
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis-command-ea-builds.sh
executable file
·52 lines (41 loc) · 1.04 KB
/
.travis-command-ea-builds.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
#!/bin/bash
set -euxo pipefail
# Prevent accidental execution outside of Travis:
if [ -z "${TRAVIS+false}" ]
then
echo "TRAVIS environment variable is not set"
exit 1
fi
# Switch to desired JDK, download if required:
function install_jdk_and_run_ea_build {
if [[ -z "$1" ]];
then
echo "JDK URL is not set. Exiting!"
exit 0
fi
JDK_URL=$1
echo "Downloading JDK from $JDK_URL"
FILENAME="${JDK_URL##*/}"
rm -rf /tmp/jdk/$JDK
mkdir -p /tmp/jdk/$JDK
if [ ! -f "/tmp/jdk/$FILENAME" ]
then
curl -L $JDK_URL -o /tmp/jdk/$FILENAME
fi
echo "Extracting archive"
tar -xzf /tmp/jdk/$FILENAME -C /tmp/jdk/$JDK --strip-components 1
echo "Completed extracting archive"
export JAVA_HOME="/tmp/jdk/$JDK"
export JDK_HOME="${JAVA_HOME}"
export JAVAC="${JAVA_HOME}/bin/javac"
export PATH="${JAVA_HOME}/bin:${PATH}"
$JAVA_HOME/bin/java -version
./mvnw -version
echo "Completed setting environment"
./mvnw install --no-transfer-progress
}
case "$JDK" in
Java14-EA)
install_jdk_and_run_ea_build ${JDK14_EA_URL}
;;
esac