[Gradle, K/N] Create compiler download temp dir inside target dir

Motivation is to make directory moving more likely atomic
Relates to KT-39016
This commit is contained in:
Alexander Likhachev
2021-02-25 17:03:15 +03:00
parent 172b5f9621
commit 9d140cacc0
@@ -128,7 +128,8 @@ class NativeCompilerDownloader(
logger.lifecycle("Unpack Kotlin/Native compiler to $compilerDirectory")
logger.lifecycleWithDuration("Unpack Kotlin/Native compiler to $compilerDirectory finished,") {
val tmpDir = Files.createTempDirectory("").toFile()
val kotlinNativeDir = compilerDirectory.parentFile.also { it.mkdirs() }
val tmpDir = Files.createTempDirectory(kotlinNativeDir.toPath(), "compiler-").toFile()
try {
logger.debug("Unpacking Kotlin/Native compiler to tmp directory $tmpDir")
project.copy {