Do not recompile module when anonymous object or local class is changed.
This commit is contained in:
@@ -143,11 +143,15 @@ public class IncrementalCacheImpl(targetDataRoot: File) : StorageOwner, Incremen
|
||||
inlinesChanged = false
|
||||
)
|
||||
header.isCompatibleClassKind() ->
|
||||
getRecompilationDecision(
|
||||
protoChanged = protoMap.put(className, BitEncoding.decodeBytes(header.annotationData)),
|
||||
constantsChanged = constantsMap.process(className, fileBytes),
|
||||
inlinesChanged = inlineFunctionsMap.process(className, fileBytes)
|
||||
)
|
||||
when (header.classKind!!) {
|
||||
JvmAnnotationNames.KotlinClass.Kind.CLASS -> getRecompilationDecision(
|
||||
protoChanged = protoMap.put(className, BitEncoding.decodeBytes(header.annotationData)),
|
||||
constantsChanged = constantsMap.process(className, fileBytes),
|
||||
inlinesChanged = inlineFunctionsMap.process(className, fileBytes)
|
||||
)
|
||||
|
||||
JvmAnnotationNames.KotlinClass.Kind.LOCAL_CLASS, JvmAnnotationNames.KotlinClass.Kind.ANONYMOUS_OBJECT -> DO_NOTHING
|
||||
}
|
||||
header.syntheticClassKind == JvmAnnotationNames.KotlinSyntheticClass.Kind.PACKAGE_PART -> {
|
||||
assert(sourceFiles.size() == 1) { "Package part from several source files: $sourceFiles" }
|
||||
|
||||
|
||||
@@ -287,6 +287,12 @@ public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("localClassChanged")
|
||||
public void testLocalClassChanged() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/localClassChanged/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("moveClass")
|
||||
public void testMoveClass() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/moveClass/");
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package a
|
||||
|
||||
// Signatures in the class "...$main$1" have changed, thus we need to recompile the whole module
|
||||
fun foo() = object {
|
||||
fun baz() = ":)"
|
||||
}
|
||||
|
||||
@@ -5,11 +5,4 @@ out/production/module/a/APackage.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/a.kt
|
||||
End of files
|
||||
Cleaning output files:
|
||||
out/production/module/usage/UsagePackage$usage$*.class
|
||||
out/production/module/usage/UsagePackage.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/usage.kt
|
||||
End of files
|
||||
@@ -0,0 +1,9 @@
|
||||
package test
|
||||
|
||||
fun foo() {
|
||||
class X {
|
||||
fun bar() = 111
|
||||
}
|
||||
|
||||
X().bar()
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package test
|
||||
|
||||
fun foo() {
|
||||
class X {
|
||||
fun bar() = 111
|
||||
fun baz() = ":)"
|
||||
}
|
||||
|
||||
X().bar()
|
||||
X().baz()
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
Cleaning output files:
|
||||
out/production/module/test/TestPackage$a$*$foo$X.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
|
||||
@@ -0,0 +1,5 @@
|
||||
package unrelated
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user