forked from eclipse-collections/eclipse-collections
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis-command-ea-builds.sh
executable file
·66 lines (55 loc) · 1.42 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
set -e
set +u
# 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
echo "export MAVEN_OPTS='-Dmaven.repo.local=$HOME/.m2/repository -Xmx2g -XX:MaxPermSize=2048m'\" > ~/.mavenrc"
mvn -version
echo "Completed setting environment"
mvn install
}
case "$JDK" in
Java8)
echo "Java 8 already exists in Travis!"
;;
Java9)
echo "Java 9 already exists in Travis!"
;;
Java10)
install_jdk_and_run_ea_build "https://download.java.net/java/GA/jdk10/10/binaries/openjdk-10_linux-x64_bin.tar.gz"
;;
Java11-EA)
install_jdk_and_run_ea_build ${JDK11_EA_URL}
;;
Java12-EA)
install_jdk_and_run_ea_build ${JDK12_EA_URL}
;;
esac