Skip to content

Commit

Permalink
Update graal (#1224)
Browse files Browse the repository at this point in the history
  • Loading branch information
gurinderu authored and muuki88 committed May 15, 2019
1 parent 35dff15 commit f3396a9
Showing 1 changed file with 28 additions and 10 deletions.
38 changes: 28 additions & 10 deletions .travis/download-graalvm
Original file line number Diff line number Diff line change
@@ -1,21 +1,39 @@
#!/bin/bash
# Make GraalVM `native-image` available and nothing else
GRAALVM_VERSION=1.0.0-rc8
GRAALVM_DISTRIBUTION=graalvm-ce-${GRAALVM_VERSION}
function setup_os_specific_envs() {
case $(uname | tr '[:upper:]' '[:lower:]') in
linux*)
OS_NAME=linux
BIN_PATH=bin
;;
darwin*)
OS_NAME=darwin
BIN_PATH=Contents/Home/bin/
;;
*)
echo "Unsupported OS"
exit
esac
}

setup_os_specific_envs
GRAALVM_VERSION=19.0.0
GRAALVM_PARENT_DIRECTORY=${HOME}/.local/share
GRAAL_DIRECTORY=${GRAALVM_PARENT_DIRECTORY}/${GRAALVM_DISTRIBUTION}
TAR_GZ_FILENAME=${GRAALVM_DISTRIBUTION}-linux-amd64.tar.gz
GRAALVM_DISTRIBUTION=graalvm-ce
GRAAL_DIRECTORY=${GRAALVM_PARENT_DIRECTORY}/${GRAALVM_DISTRIBUTION}-${GRAALVM_VERSION}
TAR_GZ_FILENAME=${GRAALVM_DISTRIBUTION}-${OS_NAME}-amd64-${GRAALVM_VERSION}.tar.gz
TAR_GZ_URL=https://github.com/oracle/graal/releases/download/vm-${GRAALVM_VERSION}/${TAR_GZ_FILENAME}
NATIVE_IMAGE=${GRAAL_DIRECTORY}/bin/native-image
NATIVE_IMAGE=${GRAAL_DIRECTORY}/${BIN_PATH}/native-image
NATIVE_IMAGE_TARGET_DIRECTORY=${HOME}/.local/bin
NATIVE_IMAGE_TARGET=${NATIVE_IMAGE_TARGET_DIRECTORY}/native-image
if [[ ! -f ${NATIVE_IMAGE} ]]
then
(mkdir -p ${GRAALVM_PARENT_DIRECTORY} &&
cd ${GRAALVM_PARENT_DIRECTORY} &&
wget -O ${TAR_GZ_FILENAME} ${TAR_GZ_URL} &&
tar zxf ${TAR_GZ_FILENAME} &&
rm -f ${TAR_GZ_FILENAME})
(mkdir -p ${GRAALVM_PARENT_DIRECTORY} &&
cd ${GRAALVM_PARENT_DIRECTORY} &&
wget -O ${TAR_GZ_FILENAME} ${TAR_GZ_URL} &&
tar zxf ${TAR_GZ_FILENAME} &&
${GRAAL_DIRECTORY}/${BIN_PATH}/gu install native-image &&
rm -f ${TAR_GZ_FILENAME})
fi
ls -lsa ${NATIVE_IMAGE}
mkdir -p ${NATIVE_IMAGE_TARGET_DIRECTORY}
Expand Down

0 comments on commit f3396a9

Please sign in to comment.