Fixed incremental compilation, when removing all callables from file.
Original commit: 4e702e34f0
This commit is contained in:
@@ -146,7 +146,7 @@ public class IncrementalCacheImpl(val baseDir: File): StorageOwner, IncrementalC
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override fun getRemovedPackageParts(sourceFilesToCompileAndFqNames: Map<File, String>): Collection<String> {
|
public override fun getRemovedPackageParts(sourceFilesToCompileAndFqNames: Map<File, String?>): Collection<String> {
|
||||||
return packagePartMap.getRemovedPackageParts(sourceFilesToCompileAndFqNames)
|
return packagePartMap.getRemovedPackageParts(sourceFilesToCompileAndFqNames)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -451,7 +451,7 @@ public class IncrementalCacheImpl(val baseDir: File): StorageOwner, IncrementalC
|
|||||||
storage.remove(sourceFile.getAbsolutePath())
|
storage.remove(sourceFile.getAbsolutePath())
|
||||||
}
|
}
|
||||||
|
|
||||||
public fun getRemovedPackageParts(compiledSourceFilesToFqName: Map<File, String>): Collection<String> {
|
public fun getRemovedPackageParts(compiledSourceFilesToFqName: Map<File, String?>): Collection<String> {
|
||||||
val result = HashSet<String>()
|
val result = HashSet<String>()
|
||||||
|
|
||||||
storage.processKeysWithExistingMapping { key ->
|
storage.processKeysWithExistingMapping { key ->
|
||||||
@@ -463,9 +463,10 @@ public class IncrementalCacheImpl(val baseDir: File): StorageOwner, IncrementalC
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
val previousPackageFqName = JvmClassName.byInternalName(packagePartClassName).getPackageFqName()
|
val previousPackageFqName = JvmClassName.byInternalName(packagePartClassName).getPackageFqName()
|
||||||
val currentPackageFqName = compiledSourceFilesToFqName[sourceFile]
|
if (sourceFile in compiledSourceFilesToFqName) {
|
||||||
if (currentPackageFqName != null && currentPackageFqName != previousPackageFqName.asString()) {
|
if (compiledSourceFilesToFqName[sourceFile] != previousPackageFqName.asString()) {
|
||||||
result.add(packagePartClassName)
|
result.add(packagePartClassName)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -493,6 +493,12 @@ public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("onlyTopLevelFunctionInFileRemoved")
|
||||||
|
public void testOnlyTopLevelFunctionInFileRemoved() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/onlyTopLevelFunctionInFileRemoved/");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("propertyRenamed")
|
@TestMetadata("propertyRenamed")
|
||||||
public void testPropertyRenamed() throws Exception {
|
public void testPropertyRenamed() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/propertyRenamed/");
|
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/propertyRenamed/");
|
||||||
|
|||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
class Usage {
|
||||||
|
void usage() {
|
||||||
|
test.TestPackage.a();
|
||||||
|
}
|
||||||
|
}
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
fun a() {
|
||||||
|
}
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
fun b() {
|
||||||
|
}
|
||||||
+2
@@ -0,0 +1,2 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
Cleaning output files:
|
||||||
|
out/production/module/test/TestPackage$b$*.class
|
||||||
|
out/production/module/test/TestPackage.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/b.kt
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/Usage.java
|
||||||
|
End of files
|
||||||
|
Cleaning output files:
|
||||||
|
out/production/module/Usage.class
|
||||||
|
out/production/module/test/TestPackage$a$*.class
|
||||||
|
out/production/module/test/TestPackage.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/a.kt
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/Usage.java
|
||||||
|
End of files
|
||||||
Reference in New Issue
Block a user