From 43c49700a5d080275b6be678082e01ec8db7c4df Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Sun, 25 Feb 2018 19:32:16 +0100 Subject: [PATCH 1/3] Include JDK 11 into the build matrix on Travis CI --- .travis.yml | 9 +++++++-- .travis/install-jdk.sh | 31 ++++++++++++++++++++++++++----- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7d944b2..fb6002c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,10 +11,15 @@ matrix: - env: JDK_RELEASE='OpenJDK 9' install: . ./.travis/install-jdk.sh -F 9 # 10 - - env: JDK_RELEASE='OracleJDK 10-ea' + - env: JDK_RELEASE='Oracle JDK 10' install: . ./.travis/install-jdk.sh -F 10 -L BCL - - env: JDK_RELEASE='OpenJDK 10-ea' + - env: JDK_RELEASE='OpenJDK 10' install: . ./.travis/install-jdk.sh -F 10 -L GPL +# 11 + - env: JDK_RELEASE='OracleJDK 11-ea' + install: . ./.travis/install-jdk.sh -F 11 -L BCL + - env: JDK_RELEASE='OpenJDK 11-ea' + install: . ./.travis/install-jdk.sh -F 11 -L GPL script: - java --version diff --git a/.travis/install-jdk.sh b/.travis/install-jdk.sh index 8119e81..ddc0679 100644 --- a/.travis/install-jdk.sh +++ b/.travis/install-jdk.sh @@ -3,19 +3,19 @@ # # Install JDK for Linux # -# Copied from: https://sormuras.github.io/blog/2017-12-08-install-jdk-on-travis -# # This script determines the most recent early-access build number, # downloads the JDK archive to the user home directory and extracts # it there. # # Example usage # -# install-jdk.sh | install most recent early-access JDK -# install-jdk.sh -W /usr/opt | install most recent early-access JDK to /usr/opt +# install-jdk.sh | install most recent (early-access) JDK +# install-jdk.sh -W /usr/opt | install most recent (early-access) JDK to /usr/opt # install-jdk.sh -F 9 | install most recent OpenJDK 9 # install-jdk.sh -F 10 | install most recent OpenJDK 10 # install-jdk.sh -F 10 -L BCL | install most recent OracleJDK 10 +# install-jdk.sh -F 11 | install most recent OpenJDK 10 +# install-jdk.sh -F 11 -L BCL | install most recent OracleJDK 10 # # Options # @@ -28,9 +28,14 @@ # # JAVA_HOME is set to the extracted JDK directory # PATH is prepended with ${JAVA_HOME}/bin +# +# (C) 2018 Christian Stein +# +# https://github.com/sormuras/bach/blob/master/install-jdk.sh +# set -e -JDK_FEATURE='10' +JDK_FEATURE='11' JDK_BUILD='?' JDK_LICENSE='GPL' JDK_WORKSPACE=${HOME} @@ -86,6 +91,22 @@ if [ "${JDK_FEATURE}" == '10' ]; then JDK_HOME=jdk-${JDK_FEATURE} fi +# +# 11 +# +if [ "${JDK_FEATURE}" == '11' ]; then + if [ "${JDK_BUILD}" == '?' ]; then + TMP=$(curl -L jdk.java.net/${JDK_FEATURE}) + TMP="${TMP#*Most recent build: jdk-${JDK_FEATURE}-ea+}" # remove everything before the number + TMP="${TMP%%<*}" # remove everything after the number + JDK_BUILD="$(echo -e "${TMP}" | tr -d '[:space:]')" # remove all whitespace + fi + + JDK_ARCHIVE=${JDK_BASENAME}-${JDK_FEATURE}-ea+${JDK_BUILD}_linux-x64_bin.tar.gz + JDK_URL=${JDK_DOWNLOAD}/early_access/jdk${JDK_FEATURE}/${JDK_BUILD}/${JDK_LICENSE}/${JDK_ARCHIVE} + JDK_HOME=jdk-${JDK_FEATURE} +fi + # # Create any missing intermediate paths, switch to workspace, download, unpack, switch back. # From a1d124dfa1fac0e1d7d65110e1bc413db7965ba1 Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Sun, 25 Feb 2018 19:42:03 +0100 Subject: [PATCH 2/3] Allow build on JDK 11 to fail, b/c "--release 11" is not supported, yet --- .travis.yml | 7 +++++-- .travis/install-jdk.sh | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index fb6002c..d677609 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ matrix: include: # 9 - jdk: oraclejdk9 - env: JDK_RELEASE='OracleJDK 9' + env: JDK_RELEASE='Oracle JDK 9' install: true - env: JDK_RELEASE='OpenJDK 9' install: . ./.travis/install-jdk.sh -F 9 @@ -16,10 +16,13 @@ matrix: - env: JDK_RELEASE='OpenJDK 10' install: . ./.travis/install-jdk.sh -F 10 -L GPL # 11 - - env: JDK_RELEASE='OracleJDK 11-ea' + - env: JDK_RELEASE='Oracle JDK 11-ea' install: . ./.travis/install-jdk.sh -F 11 -L BCL - env: JDK_RELEASE='OpenJDK 11-ea' install: . ./.travis/install-jdk.sh -F 11 -L GPL + allow_failures: + - env: JDK_RELEASE='Oracle JDK 11-ea' + - env: JDK_RELEASE='OpenJDK 11-ea' script: - java --version diff --git a/.travis/install-jdk.sh b/.travis/install-jdk.sh index ddc0679..14b8b48 100644 --- a/.travis/install-jdk.sh +++ b/.travis/install-jdk.sh @@ -19,7 +19,7 @@ # # Options # -# -F f | Feature number of the JDK release, [9|10|...] +# -F f | Feature number of the JDK release [9|10|...] # -B b | Build number of the JDK release [?|1|2...] # -L l | License of the JDK [GPL|BCL] # -W w | Working directory and install path [${HOME}] From 50f003071fca5454195ddf6616873e463779611e Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Sun, 25 Feb 2018 21:28:58 +0100 Subject: [PATCH 3/3] Fix typo --- .travis/install-jdk.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis/install-jdk.sh b/.travis/install-jdk.sh index 14b8b48..4039c21 100644 --- a/.travis/install-jdk.sh +++ b/.travis/install-jdk.sh @@ -13,9 +13,9 @@ # install-jdk.sh -W /usr/opt | install most recent (early-access) JDK to /usr/opt # install-jdk.sh -F 9 | install most recent OpenJDK 9 # install-jdk.sh -F 10 | install most recent OpenJDK 10 -# install-jdk.sh -F 10 -L BCL | install most recent OracleJDK 10 -# install-jdk.sh -F 11 | install most recent OpenJDK 10 -# install-jdk.sh -F 11 -L BCL | install most recent OracleJDK 10 +# install-jdk.sh -F 10 -L BCL | install most recent Oracle JDK 10 +# install-jdk.sh -F 11 | install most recent OpenJDK 11 +# install-jdk.sh -F 11 -L BCL | install most recent Oracle JDK 11 # # Options #