mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
External dependencies: preserve symlinks while unpacking JDKs on Mac
This commit is contained in:
@@ -60,24 +60,23 @@ task setupJdk18(dependsOn: downloadJdk18) {
|
||||
def unpackJdk(jdkArchive, outputDir) {
|
||||
logger.info("Unpacking $jdkArchive to ${outputDir}")
|
||||
file(outputDir).deleteDir()
|
||||
if (!org.gradle.internal.os.OperatingSystem.current().isWindows()) {
|
||||
exec { commandLine 'mkdir', '-p', outputDir }
|
||||
exec { commandLine 'tar', 'xpf', "${jdkArchive.absolutePath}", '--directory', outputDir }
|
||||
def jdkContents = file("${outputDir}/jdk/Contents")
|
||||
if (org.gradle.internal.os.OperatingSystem.current().isMacOsX() && jdkContents.exists()) {
|
||||
copy {
|
||||
from fileTree(jdkContents)
|
||||
into outputDir
|
||||
}
|
||||
jdkContents.deleteDir()
|
||||
}
|
||||
}
|
||||
else {
|
||||
def currentOs = org.gradle.internal.os.OperatingSystem.current()
|
||||
if (currentOs.isWindows()) {
|
||||
copy {
|
||||
from tarTree(jdkArchive)
|
||||
into outputDir
|
||||
}
|
||||
}
|
||||
else {
|
||||
exec { commandLine 'mkdir', '-p', outputDir }
|
||||
exec { commandLine 'tar', 'xpf', "$jdkArchive.absolutePath", '--directory', outputDir }
|
||||
def jdkContents = file("${outputDir}/jdk/Contents")
|
||||
if (currentOs.isMacOsX() && jdkContents.exists()) {
|
||||
jdkContents.listFiles().each { file ->
|
||||
exec { commandLine 'mv', "$file.absolutePath", outputDir }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static def currentPlatformName() {
|
||||
|
||||
Reference in New Issue
Block a user