Avoid deserializing .kotlin_module as class proto

#KT-20184 fixed
This commit is contained in:
Alexey Tsvetkov
2017-11-14 21:55:08 +03:00
parent c55ac55526
commit 18261838b6
8 changed files with 37 additions and 1 deletions
@@ -287,7 +287,9 @@ open class IncrementalJvmCache(
fun remove(className: JvmClassName, changesCollector: ChangesCollector) {
val key = className.internalName
val oldValue = storage[key] ?: return
changesCollector.collectProtoChanges(oldData = oldValue.toProtoData(className.packageFqName), newData = null)
if (key != MODULE_MAPPING_FILE_NAME) {
changesCollector.collectProtoChanges(oldData = oldValue.toProtoData(className.packageFqName), newData = null)
}
storage.remove(key)
}
@@ -1315,6 +1315,12 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, true);
}
@TestMetadata("allKotlinFilesRemovedThenNewAdded")
public void testAllKotlinFilesRemovedThenNewAdded() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/other/allKotlinFilesRemovedThenNewAdded/");
doTest(fileName);
}
@TestMetadata("classToPackageFacade")
public void testClassToPackageFacade() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/other/classToPackageFacade/");
@@ -1156,6 +1156,12 @@ public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, true);
}
@TestMetadata("allKotlinFilesRemovedThenNewAdded")
public void testAllKotlinFilesRemovedThenNewAdded() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/other/allKotlinFilesRemovedThenNewAdded/");
doTest(fileName);
}
@TestMetadata("classToPackageFacade")
public void testClassToPackageFacade() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/other/classToPackageFacade/");
@@ -0,0 +1 @@
public class A {}
@@ -0,0 +1,18 @@
================ Step #1 =================
Cleaning output files:
out/production/module/META-INF/module.kotlin_module
out/production/module/MainKt.class
End of files
Compiling files:
End of files
Exit code: OK
------------------------------------------
================ Step #2 =================
Compiling files:
src/B.kt
End of files
Exit code: OK
------------------------------------------
@@ -0,0 +1,2 @@
fun main(args: Array<String>) {
}