diff --git a/jps/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/IncrementalCacheImpl.kt b/jps/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/IncrementalCacheImpl.kt index 9b0735d149b..a2718bf2b42 100644 --- a/jps/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/IncrementalCacheImpl.kt +++ b/jps/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/IncrementalCacheImpl.kt @@ -149,6 +149,7 @@ public class IncrementalCacheImpl( private val cacheFormatVersion = CacheFormatVersion(targetDataRoot) private val dependents = arrayListOf() + private val outputDir = requireNotNull(target.outputDir) { "Target is expected to have output directory: $target" } private val inlineRegistering = object : InlineRegistering { override fun registerInline(fromPath: String, jvmSignature: String, toPath: String) { @@ -181,7 +182,6 @@ public class IncrementalCacheImpl( public fun getFilesToReinline(): Collection { val result = THashSet(FileUtil.PATH_HASHING_STRATEGY) - val outPath = target?.outputDir!! for ((className, functions) in dirtyInlineFunctionsMap.getEntries()) { val sourceFiles = classToSourcesMap[className] @@ -199,11 +199,10 @@ public class IncrementalCacheImpl( internalName = packageJvmName.internalName } - val classFile = File(outPath, "$internalName.class") - val classFileName = classFile.normalizedPath + val classFilePath = getClassFilePath(internalName) for (dependent in dependents) { - val targetFiles = functions.flatMap { dependent.hasInlineTo[classFileName, it] } + val targetFiles = functions.flatMap { dependent.hasInlineTo[classFilePath, it] } result.addAll(targetFiles) } } @@ -212,6 +211,10 @@ public class IncrementalCacheImpl( return result.map { File(it) } } + override fun getClassFilePath(internalClassName: String): String { + return File(outputDir, "$internalClassName.class").canonicalPath + } + private fun getRecompilationDecision(protoChanged: Boolean, constantsChanged: Boolean) = when { constantsChanged -> RECOMPILE_OTHER_IN_CHUNK_AND_DEPENDANTS