Change generated cache dir name according to change in Big Kotlin

The cache directory naming will be changed in the Big Kotlin repo.
This patch takes these changes into account and renames the cache
directory generated during the build.

Corresponding commit in the Big Kotlin:
https://github.com/JetBrains/kotlin/commit/ce2446f80fac6ec088eedd32c7b2e6cfae012e8c
This commit is contained in:
Ilya Matveev
2019-12-21 12:16:17 +03:00
committed by Ilya Matveev
parent b78c7b5f4e
commit b065a35545
2 changed files with 8 additions and 5 deletions
+2 -2
View File
@@ -65,7 +65,7 @@ project.rootProject.ext.platformManager.enabled.each { target ->
task "${targetName}StdlibCache"(type: KonanCacheTask) {
it.target = targetName
originalKlib = file("$konanHome/klib/common/stdlib")
cacheDirectory = file("$konanHome/klib/cache/$targetName-g")
cacheRoot = file("$konanHome/klib/cache")
dependsOn ":${targetName}CrossDist"
}
@@ -106,7 +106,7 @@ project.rootProject.ext.platformManager.enabled.each { target ->
task "${libName}Cache"(type: KonanCacheTask) {
it.target = targetName
originalKlib = tasks[libName].installDir
cacheDirectory = file("$konanHome/klib/cache/$targetName-g")
cacheRoot = file("$konanHome/klib/cache")
dependsOn "${targetName}StdlibCache"
dependsOn tasks[libName]
@@ -3,10 +3,8 @@ package org.jetbrains.kotlin.gradle.plugin.konan.tasks
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.*
import org.jetbrains.kotlin.gradle.plugin.konan.KonanCompilerRunner
import org.jetbrains.kotlin.gradle.plugin.tasks.KonanTargetableTask
import org.jetbrains.kotlin.konan.target.CompilerOutputKind
import org.jetbrains.kotlin.konan.target.HostManager
import org.jetbrains.kotlin.konan.target.KonanTarget
import java.io.File
enum class KonanCacheKind(val outputKind: CompilerOutputKind) {
@@ -20,11 +18,16 @@ open class KonanCacheTask: DefaultTask() {
// Taken into account by the [cacheFile] property.
@Internal
lateinit var cacheDirectory: File
lateinit var cacheRoot: File
@get:Input
lateinit var target: String
@get:Internal
// TODO: Reuse NativeCacheKind from Big Kotlin plugin when it is available.
val cacheDirectory: File
get() = cacheRoot.resolve("$target-g$cacheKind")
@get:OutputFile
protected val cacheFile: File
get() {