source: trunk/abcl/ci/install-adoptjdk.bash @ 15259

Last change on this file since 15259 was 15259, checked in by Mark Evenson, 2 years ago

build: support abcl.properties creation openjdk{6,7,8,11,13,14}

Additionally add test for openjdk14 to the Travis-CI build.

Improve script for creating build properties, which may be invoked
like:

bash ci/create-abcl-properties.bash openjdk8

Currently this script has baked-in "knowledge" of options for various
platforms for now, but will eventually directly transcribe from the
"facts" in <file:abcl.rdf>.

  • * *

Update RDF

File size: 2.5 KB
Line 
1#!/usr/bin/env bash
2DIR="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
3
4. ${DIR}/install-jenv.bash
5
6jdk=$1
7if [[ -z $jdk ]]; then
8    jdk=openjdk8
9fi
10
11# empty variables are not necessary, but a hint that these are not
12# lexically scoped in their modification.
13topdir=
14dist=
15function determine_adoptjdk() {
16    case $(uname) in
17        Darwin)
18            case $jdk in
19                openjdk8)
20                    topdir=jdk8u242-b08
21                    dist="https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u242-b08/OpenJDK8U-jdk_x64_mac_hotspot_8u242b08.tar.gz"
22                    ;;
23                openjdk11)
24                    topdir=jdk-11.0.6+10
25                    dist="https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10/OpenJDK11U-jdk_x64_mac_hotspot_11.0.6_10.tar.gz"
26                    ;;
27                openjdk14)
28                    topdir=jdk-14.0.1+7
29                    dist="https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk-14.0.1%2B7/OpenJDK14U-jdk_x64_mac_hotspot_14.0.1_7.tar.gz"
30                    ;;
31            esac
32            ;;
33        Linux)
34            case $jdk in
35                openjdk8)
36                    topdir=jdk8u242-b08
37                    dist="https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u242-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u242b08.tar.gz"
38                    ;;
39                openjdk11)
40                    topdir=jdk-11.0.6+10
41                    dist="https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.6%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.6_10.tar.gz"
42                    ;;
43                openjdk14)
44                    topdir=jdk-14.0.1+7
45                    dist="https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk-14.0.1%2B7/OpenJDK14U-jdk_x64_linux_hotspot_14.0.1_7.tar.gz"
46                    ;;
47            esac
48            ;;
49        *)
50            echo No known dist for $(uname)
51    esac
52}
53
54tmpdir=/var/tmp
55
56function download_and_extract() {
57    pushd ${tmpdir} && wget --continue ${dist}
58   
59    tar xvz -f $(basename ${dist})
60
61    popd
62}
63
64function add_jdk() {
65    echo $dist
66    echo $tmpdir
67    case $(uname) in
68        Darwin)
69            jenv add ${tmpdir}/${topdir}/Contents/Home
70            ;;
71        Linux)
72            jenv add ${tmpdir}/${topdir}
73            ;;
74    esac
75}
76
77determine_adoptjdk
78download_and_extract
79add_jdk
80
81. ${DIR}/set-jdk.bash
82
83jenv doctor
84
85
86
87
88
89
90
Note: See TracBrowser for help on using the repository browser.