From 3dd93fb0694a3375dedb4ad5f9596a1781b30caa Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Tue, 26 Oct 2021 18:06:31 +0100 Subject: [PATCH] JAL-3907 adjusted download_jdks.sh and download_jres.sh scripts to use adoptium and added Java 17 download. Added JAVA_VERSION=17 as a gradle build property option. --- build.gradle | 14 +++--- utils/download_jdks.sh | 72 +++++++++++++-------------- utils/download_jres.sh | 129 ++++++++++++++++++++++++------------------------ 3 files changed, 108 insertions(+), 107 deletions(-) diff --git a/build.gradle b/build.gradle index 8efe39d..17407a9 100644 --- a/build.gradle +++ b/build.gradle @@ -420,16 +420,16 @@ ext { '--add-modules', j11modules ] */ - } else if (JAVA_VERSION.equals("12") || JAVA_VERSION.equals("13")) { - JAVA_INTEGER_VERSION = JAVA_VERSION - libDir = j11libDir - libDistDir = j11libDir - compile_source_compatibility = JAVA_VERSION - compile_target_compatibility = JAVA_VERSION + } else if (JAVA_VERSION.equals("17")) { + JAVA_INTEGER_VERSION = string("17") + libDir = j17libDir + libDistDir = j17libDir + compile_source_compatibility = 17 + compile_target_compatibility = 17 getdownAltJavaMinVersion = string(findProperty("getdown_alt_java11_min_version")) getdownAltJavaMaxVersion = string(findProperty("getdown_alt_java11_max_version")) getdownAltMultiJavaLocation = string(findProperty("getdown_alt_java11_txt_multi_java_location")) - eclipseJavaRuntimeName = string("JavaSE-11") + eclipseJavaRuntimeName = string("JavaSE-17") /* compile without modules -- using classpath libraries additional_compiler_args += [ '--module-path', modules_compileClasspath.asPath, diff --git a/utils/download_jdks.sh b/utils/download_jdks.sh index c488d80..cf8634a 100755 --- a/utils/download_jdks.sh +++ b/utils/download_jdks.sh @@ -11,12 +11,14 @@ ### and ### ./tgz/jre-VERSION-OS-ARCH.tgz ### which is an archive of the _contents_ of ./jre-VERSION-OS-ARCH/jre/ and used by install4j for the installer +### bs 2021-10-26 +### Edited to use adoptium domain to gain access to Java 17 (LTS) versions. -BASE=https://api.adoptopenjdk.net/v3/binary/latest +BASE=https://api.adoptium.net/v3/binary/latest RELEASE_TYPE=ga JVM_IMPL=hotspot HEAP_SIZE=normal -VENDOR=adoptopenjdk +VENDOR=eclipse IMAGE_TYPE=jdk RM=/bin/rm @@ -34,40 +36,38 @@ unzip-strip() ( fi && rmdir "$temp"/* "$temp" ) -for FEATURE_VERSION in 8 11 12 13; do - for OS in mac; do - #for OS in linux mac windows; do - for ARCH in x64; do - #for ARCH in aarch64 arm x32 x64; do - NAME="${IMAGE_TYPE}-${FEATURE_VERSION}-${OS}-${ARCH}" - TARFILE="${NAME}.tgz" - echo "* Downloading ${TARFILE}" - URL="${BASE}/${FEATURE_VERSION}/${RELEASE_TYPE}/${OS}/${ARCH}/${IMAGE_TYPE}/${JVM_IMPL}/${HEAP_SIZE}/${VENDOR}" - wget -q -O "${TARFILE}" "${URL}" - if [ "$?" != 0 ]; then - echo "- No ${IMAGE_TYPE}-${FEATURE_VERSION} download for ${OS}-${ARCH} '${URL}'" - $RM -f "${TARFILE}" - continue; - fi - echo "Unpacking ${TARFILE}" - JREDIR="${NAME}/${IMAGE_TYPE}" - [ x$NAME != x -a -e "${JREDIR}" ] && $RM -rf "${JREDIR}" - mkdir -p "${JREDIR}" - if [ x$OS = xwindows ]; then - echo "using unzip" - unzip-strip "${TARFILE}" "${JREDIR}" - RET=$? - else - echo "using tar" - tar --strip-components=1 -C "${JREDIR}" -zxf "${TARFILE}" - RET=$? - fi - if [ "$RET" != 0 ]; then - echo "Error unpacking ${TARFILE}" - exit 1 - fi - $RM "${TARFILE}" - done +for FEATURE_VERSION in 8 11 17; do + for OS_ARCH in mac:x64 mac:aarch64 windows:x64 linux:x64 linux:arm linux:aarch64; do + OS=${OS_ARCH%:*} + ARCH=${OS_ARCH#*:} + NAME="${IMAGE_TYPE}-${FEATURE_VERSION}-${OS}-${ARCH}" + TARFILE="${NAME}.tgz" + echo "* Downloading ${TARFILE}" + URL="${BASE}/${FEATURE_VERSION}/${RELEASE_TYPE}/${OS}/${ARCH}/${IMAGE_TYPE}/${JVM_IMPL}/${HEAP_SIZE}/${VENDOR}" + wget -q -O "${TARFILE}" "${URL}" + if [ "$?" != 0 ]; then + echo "- No ${IMAGE_TYPE}-${FEATURE_VERSION} download for ${OS}-${ARCH} '${URL}'" + $RM -f "${TARFILE}" + continue; + fi + echo "Unpacking ${TARFILE}" + JREDIR="${NAME}/${IMAGE_TYPE}" + [ x$NAME != x -a -e "${JREDIR}" ] && $RM -rf "${JREDIR}" + mkdir -p "${JREDIR}" + if [ x$OS = xwindows ]; then + echo "using unzip" + unzip-strip "${TARFILE}" "${JREDIR}" + RET=$? + else + echo "using tar" + tar --strip-components=1 -C "${JREDIR}" -zxf "${TARFILE}" + RET=$? + fi + if [ "$RET" != 0 ]; then + echo "Error unpacking ${TARFILE}" + exit 1 + fi + $RM "${TARFILE}" done done diff --git a/utils/download_jres.sh b/utils/download_jres.sh index 89ed8fc..5aa4b57 100755 --- a/utils/download_jres.sh +++ b/utils/download_jres.sh @@ -11,12 +11,14 @@ ### and ### ./tgz/jre-VERSION-OS-ARCH.tgz ### which is an archive of the _contents_ of ./jre-VERSION-OS-ARCH/jre/ and used by install4j for the installer +### bs 2021-10-26 +### Edited to use adoptium domain to gain access to Java 17 (LTS) versions. -BASE=https://api.adoptopenjdk.net/v3/binary/latest +BASE=https://api.adoptium.net/v3/binary/latest RELEASE_TYPE=ga JVM_IMPL=hotspot HEAP_SIZE=normal -VENDOR=adoptopenjdk +VENDOR=eclipse IMAGE_TYPE=jre TAR=tar ZIP=zip @@ -41,71 +43,70 @@ unzip-strip() ( fi && rmdir "$temp"/* "$temp" ) -for FEATURE_VERSION in 8 11; do - for OS in linux mac windows; do - for ARCH in x64 x32 arm; do - #for ARCH in aarch64 arm x32 x64; do - NAME="${IMAGE_TYPE}-${FEATURE_VERSION}-${OS}-${ARCH}" - TARFILE="${NAME}.tgz" - echo "* Downloading ${TARFILE}" - URL="${BASE}/${FEATURE_VERSION}/${RELEASE_TYPE}/${OS}/${ARCH}/${IMAGE_TYPE}/${JVM_IMPL}/${HEAP_SIZE}/${VENDOR}" - wget -q -O "${TARFILE}" "${URL}" - if [ "$?" != 0 ]; then - echo "- No ${IMAGE_TYPE}-${FEATURE_VERSION} download for ${OS}-${ARCH} '${URL}'" - $RM -f "${TARFILE}" - continue; - fi - echo "Unpacking ${TARFILE}" - JREDIR="${NAME}/${IMAGE_TYPE}" - [ x$NAME != x -a -e "${JREDIR}" ] && $RM -rf "${JREDIR}" - mkdir -p "${JREDIR}" - if [ x$OS = xwindows ]; then - echo "using unzip" - unzip-strip "${TARFILE}" "${JREDIR}" +for FEATURE_VERSION in 8 11 17; do + for OS_ARCH in mac:x64 mac:aarch64 windows:x64 linux:x64 linux:arm linux:aarch64; do + OS=${OS_ARCH%:*} + ARCH=${OS_ARCH#*:} + NAME="${IMAGE_TYPE}-${FEATURE_VERSION}-${OS}-${ARCH}" + TARFILE="${NAME}.tgz" + echo "* Downloading ${TARFILE}" + URL="${BASE}/${FEATURE_VERSION}/${RELEASE_TYPE}/${OS}/${ARCH}/${IMAGE_TYPE}/${JVM_IMPL}/${HEAP_SIZE}/${VENDOR}" + wget -q -O "${TARFILE}" "${URL}" + if [ "$?" != 0 ]; then + echo "- No ${IMAGE_TYPE}-${FEATURE_VERSION} download for ${OS}-${ARCH} '${URL}'" + $RM -f "${TARFILE}" + continue; + fi + echo "Unpacking ${TARFILE}" + JREDIR="${NAME}/${IMAGE_TYPE}" + [ x$NAME != x -a -e "${JREDIR}" ] && $RM -rf "${JREDIR}" + mkdir -p "${JREDIR}" + if [ x$OS = xwindows ]; then + echo "using unzip" + unzip-strip "${TARFILE}" "${JREDIR}" + RET=$? + else + echo "using tar" + if [ x$OS = xmac -a x$STRIP_MAC_APP_BUNDLING = xtrue ]; then + $TAR --strip-components=3 -C "${JREDIR}" -zxf "${TARFILE}" "*/Contents/Home" RET=$? else - echo "using tar" - if [ x$OS = xmac -a x$STRIP_MAC_APP_BUNDLING = xtrue ]; then - $TAR --strip-components=3 -C "${JREDIR}" -zxf "${TARFILE}" "*/Contents/Home" - RET=$? - else - $TAR --strip-components=1 -C "${JREDIR}" -zxf "${TARFILE}" - RET=$? - fi - fi - if [ "$RET" != 0 ]; then - echo "Error unpacking ${TARFILE}" - exit 1 - fi - $RM "${TARFILE}" - if [ \! -z "$CREATE_ARCHIVES" ]; then - for CREATEARCHIVE in ${CREATE_ARCHIVES}; do - ARCHIVEDIR=$CREATEARCHIVE - case $CREATEARCHIVE in - zip) - EXT=${CREATEARCHIVE} - echo "Creating ${NAME}.${EXT} for getdown updates" - [ \! -d ${ARCHIVEDIR} ] && mkdir -p "${ARCHIVEDIR}" - ABSARCHIVEDIR="${PWD}/$ARCHIVEDIR" - ZIPFILE="${ABSARCHIVEDIR}/${NAME}.${CREATEARCHIVE}" - [ -e "${ZIPFILE}" ] && $RM "${ZIPFILE}" - cd ${NAME} - $ZIP -X -r "${ZIPFILE}" "${IMAGE_TYPE}" - cd - - ;; - tgz) - EXT=tar.gz - echo "Creating ${NAME}.${EXT} for install4j bundling" - [ \! -d ${ARCHIVEDIR} ] && mkdir -p "${ARCHIVEDIR}" - $TAR -C "${JREDIR}" -zcf "${ARCHIVEDIR}/${NAME}.${EXT}" . - ;; - *) - echo "Archiving as '${CREATEARCHIVE}' file not supported" - ;; - esac - done + $TAR --strip-components=1 -C "${JREDIR}" -zxf "${TARFILE}" + RET=$? fi - done + fi + if [ "$RET" != 0 ]; then + echo "Error unpacking ${TARFILE}" + exit 1 + fi + $RM "${TARFILE}" + if [ \! -z "$CREATE_ARCHIVES" ]; then + for CREATEARCHIVE in ${CREATE_ARCHIVES}; do + ARCHIVEDIR=$CREATEARCHIVE + case $CREATEARCHIVE in + zip) + EXT=${CREATEARCHIVE} + echo "Creating ${NAME}.${EXT} for getdown updates" + [ \! -d ${ARCHIVEDIR} ] && mkdir -p "${ARCHIVEDIR}" + ABSARCHIVEDIR="${PWD}/$ARCHIVEDIR" + ZIPFILE="${ABSARCHIVEDIR}/${NAME}.${CREATEARCHIVE}" + [ -e "${ZIPFILE}" ] && $RM "${ZIPFILE}" + cd ${NAME} + $ZIP -X -r "${ZIPFILE}" "${IMAGE_TYPE}" + cd - + ;; + tgz) + EXT=tar.gz + echo "Creating ${NAME}.${EXT} for install4j bundling" + [ \! -d ${ARCHIVEDIR} ] && mkdir -p "${ARCHIVEDIR}" + $TAR -C "${JREDIR}" -zcf "${ARCHIVEDIR}/${NAME}.${EXT}" . + ;; + *) + echo "Archiving as '${CREATEARCHIVE}' file not supported" + ;; + esac + done + fi done done -- 1.7.10.2