From cdfb2d22482317ba9c33cfdbfd80a81f332054e8 Mon Sep 17 00:00:00 2001 From: Dmitry Batrak Date: Mon, 30 Jan 2017 15:43:05 +0300 Subject: [PATCH] fix updating JDK from update.sh on macOS --- build/scripts/download_jre.gant | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/build/scripts/download_jre.gant b/build/scripts/download_jre.gant index b3b58bb65d60..1c2e224e26d1 100644 --- a/build/scripts/download_jre.gant +++ b/build/scripts/download_jre.gant @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ target('default': 'Downloads custom JRE build from Teamcity server') { return } - java(jvm: SystemInfo.isMac ? "$workIdeaHome/jre/jdk/Contents/Home/jre/bin/java" : "$workIdeaHome/jre/jre/bin/java", + java(jvm: SystemInfo.isMac ? "$workIdeaHome/jdk/Contents/Home/jre/bin/java" : "$workIdeaHome/jre/jre/bin/java", fork: "true", classname: "dummy", outputproperty: "jvmVersionOutput") { jvmarg(value: "-version") } @@ -62,11 +62,19 @@ target('default': 'Downloads custom JRE build from Teamcity server') { it.startsWith(jreArtifactPrefix) && it.endsWith(jreArchitecture == "64" ? "_x64.tar.gz" : "_x86.tar.gz") && !it.contains("debug") } get src: "$jreTeamcityUrl/builds/id:$buildId/artifacts/content/$platform/$artifact", dest: deployDir - mkdir dir: "$deployDir/jre" if (SystemInfo.isWindows) { + mkdir dir: "$deployDir/jre" untar src: "$deployDir/$artifact", dest: "$deployDir/jre", compression: "gzip" } - else { + else if (SystemInfo.isMac) { + // untar task doesn't support symlinks, so we need to use native tar executable + exec(executable: "tar", dir: "$deployDir") { + arg(value: "-xf") + arg(value: "$artifact") + } + } + else if (SystemInfo.isLinux) { + mkdir dir: "$deployDir/jre" // untar task doesn't support symlinks, so we need to use native tar executable exec(executable: "tar", dir: "$deployDir") { arg(value: "-xf")