[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.
This commit is contained in:
Ilya Matveev
2020-09-16 20:20:24 +07:00
committed by Ilya Matveev
parent 251cf1220b
commit 83b8240dbb
@@ -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")
}