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() {