From a920bdba00e44878cc49fbf34d25d6b6c6d1041a Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Thu, 5 Apr 2018 13:23:20 +0200 Subject: [PATCH] Cleanup (IDEA-CR-30753) --- build/dependencies/setupJdk.gradle | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/build/dependencies/setupJdk.gradle b/build/dependencies/setupJdk.gradle index d2cdd128c9e8..225ae67c6aa7 100644 --- a/build/dependencies/setupJdk.gradle +++ b/build/dependencies/setupJdk.gradle @@ -113,18 +113,12 @@ task setupJdk16(dependsOn: configurations.jdk16) { logger.info("Setting up JDK 1.6 to compile") unpackJdk(jdkArchive.call(), outputDir) deleteBrokenSymlink(outputDir) - if (!new File(outputDir, "bin").exists() && new File(outputDir, "jre/bin").exists()) { - copy { - from file(new File(outputDir, "jre/bin")) - into file(new File(outputDir, "bin")) - include 'java*' - } - } + createMissingLauncher(outputDir) } } // Gradle dies on trying to process broken links: https://issues.gradle.org/browse/GRADLE-1843 -private void deleteBrokenSymlink(def outputDir) { +private void deleteBrokenSymlink(String outputDir) { if (org.gradle.internal.os.OperatingSystem.current().isMacOsX()) { def pluginJar = file("$outputDir/Contents/Home/lib/plugin.jar") if (!pluginJar.exists()) { @@ -135,6 +129,17 @@ private void deleteBrokenSymlink(def outputDir) { } } +// some JPS builders rely on a launcher presence in /bin directory +private void createMissingLauncher(String outputDir) { + if (!new File(outputDir, "bin").exists() && new File(outputDir, "jre/bin").exists()) { + copy { + from file(new File(outputDir, "jre/bin")) + into file(new File(outputDir, "bin")) + include 'java*' + } + } +} + setupJdk16.onlyIf { inJetBrainsNetwork } def intellijProjectDir() {