Explicitly request rebuild when untracked java file is removed

Previously a rebuild was happenning because FileNotFoundException
was thrown when getting psiFile of removed file.
This commit is contained in:
Alexey Tsvetkov
2017-12-20 00:33:52 +03:00
parent 61cb39a600
commit ee94a64718
2 changed files with 20 additions and 0 deletions
@@ -224,6 +224,12 @@ class IncrementalJvmCompilerRunner(
for (javaFile in javaFiles) {
if (!caches.platformCache.isTrackedFile(javaFile)) {
if (!javaFile.exists()) {
// todo: can we do this more optimal?
reporter.report { "Could not get changed for untracked removed java file $javaFile" }
return false
}
val psiFile = javaFile.psiFile()
if (psiFile !is PsiJavaFile) {
reporter.report { "[Precise Java tracking] Expected PsiJavaFile, got ${psiFile?.javaClass}" }
@@ -0,0 +1,14 @@
================ Step #1 =================
Compiling files:
src/TheClass.kt
src/other.kt
End of files
Exit code: OK
================ Step #2 =================
Compiling files:
End of files
Exit code: OK