Don't call File.getCanonicalPath in KGP

Relates to KT-54579.
This commit is contained in:
Andrey Uskov
2022-11-23 16:41:21 +03:00
committed by teamcity
parent ca8f234f28
commit 41ff283856
27 changed files with 50 additions and 50 deletions
@@ -23,7 +23,7 @@ abstract class ICReporterBase(private val pathsBase: File? = null) : ICReporter
}
protected fun relativizeIfPossible(files: Iterable<File>): List<File> =
files.map { it.relativeOrCanonical() }
files.map { it.relativeOrAbsolute() }
protected fun pathsAsString(files: Iterable<File>): String =
relativizeIfPossible(files).map { it.path }.sorted().joinToString()
@@ -31,6 +31,6 @@ abstract class ICReporterBase(private val pathsBase: File? = null) : ICReporter
protected fun pathsAsString(vararg files: File): String =
pathsAsString(files.toList())
protected fun File.relativeOrCanonical(): File =
pathsBase?.let { relativeToOrNull(it) } ?: canonicalFile
protected fun File.relativeOrAbsolute(): File =
pathsBase?.let { relativeToOrNull(it) } ?: normalize().absoluteFile
}
@@ -104,7 +104,7 @@ open class IncrementalJvmCache(
className in multifileFacadeToParts
override fun getClassFilePath(internalClassName: String): String {
return toSystemIndependentName(File(outputDir, "$internalClassName.class").canonicalPath)
return toSystemIndependentName(File(outputDir, "$internalClassName.class").normalize().absolutePath)
}
fun saveModuleMappingToCache(sourceFiles: Collection<File>, file: File) {