[K/N][build] Small fixes to KonanCacheTask
This commit is contained in:
+2
-4
@@ -19,7 +19,6 @@ open class KonanCacheTask: DefaultTask() {
|
|||||||
@get:InputDirectory
|
@get:InputDirectory
|
||||||
lateinit var originalKlib: File
|
lateinit var originalKlib: File
|
||||||
|
|
||||||
// Taken into account by the [cacheFile] property.
|
|
||||||
@get:Input
|
@get:Input
|
||||||
lateinit var cacheRoot: String
|
lateinit var cacheRoot: String
|
||||||
|
|
||||||
@@ -29,9 +28,7 @@ open class KonanCacheTask: DefaultTask() {
|
|||||||
@get:Internal
|
@get:Internal
|
||||||
// TODO: Reuse NativeCacheKind from Big Kotlin plugin when it is available.
|
// TODO: Reuse NativeCacheKind from Big Kotlin plugin when it is available.
|
||||||
val cacheDirectory: File
|
val cacheDirectory: File
|
||||||
get() = File(cacheRoot).apply {
|
get() = File("$cacheRoot/$target-g$cacheKind")
|
||||||
if (!exists()) mkdir()
|
|
||||||
}.resolve("$target-g$cacheKind")
|
|
||||||
|
|
||||||
@get:OutputDirectory
|
@get:OutputDirectory
|
||||||
val cacheFile: File
|
val cacheFile: File
|
||||||
@@ -62,6 +59,7 @@ open class KonanCacheTask: DefaultTask() {
|
|||||||
val deleted = cacheFile.deleteRecursively()
|
val deleted = cacheFile.deleteRecursively()
|
||||||
check(deleted) { "Cannot delete stale cache: ${cacheFile.absolutePath}" }
|
check(deleted) { "Cannot delete stale cache: ${cacheFile.absolutePath}" }
|
||||||
}
|
}
|
||||||
|
cacheDirectory.mkdirs()
|
||||||
val konanHome = compilerDistributionPath.get().absolutePath
|
val konanHome = compilerDistributionPath.get().absolutePath
|
||||||
val additionalCacheFlags = PlatformManager(konanHome).let {
|
val additionalCacheFlags = PlatformManager(konanHome).let {
|
||||||
it.targetByName(target).let(it::loader).additionalCacheFlags
|
it.targetByName(target).let(it::loader).additionalCacheFlags
|
||||||
|
|||||||
Reference in New Issue
Block a user