Cleanup (IDEA-CR-30753)

This commit is contained in:
Roman Shevchenko
2018-04-05 13:23:20 +02:00
parent c1ecf63674
commit a920bdba00
+13 -8
View File
@@ -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 <JDK>/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() {