From 83b8240dbb974370bf88955e6da47ccdcf7c68fe Mon Sep 17 00:00:00 2001 From: Ilya Matveev Date: Wed, 16 Sep 2020 20:20:24 +0700 Subject: [PATCH] [build] Fix outputs for the cache task A klib filename without extension was used to determine a name of a cache directory for this klib. This is incorrect if the klib is stored in a directory with dots in its name. This breaks up-to-date checks, so Gradle doesn't rerun the task if the cache directory was deleted. This patch fixes this issue. --- .../kotlin/gradle/plugin/konan/tasks/KonanCacheTask.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanCacheTask.kt b/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanCacheTask.kt index dee904cbff3..abe200aefc7 100644 --- a/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanCacheTask.kt +++ b/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanCacheTask.kt @@ -34,7 +34,9 @@ open class KonanCacheTask: DefaultTask() { @get:OutputDirectory protected val cacheFile: File get() { - val klibName = originalKlib.nameWithoutExtension + val klibName = originalKlib.let { + if (it.isDirectory) it.name else it.nameWithoutExtension + } return cacheDirectory.resolve("${klibName}-cache") }