Do not recompile files compiled in current round
Original commit: 4800cff87f
This commit is contained in:
@@ -242,13 +242,14 @@ public class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR
|
||||
}
|
||||
|
||||
val caches = filesToCompile.keySet().map { incrementalCaches[it]!! }
|
||||
processChanges(filesToCompile.values(), allCompiledFiles, dataManager, caches, changesInfo, fsOperations)
|
||||
processChanges(filesToCompile.values().toSet(), allCompiledFiles, dataManager, caches, changesInfo, fsOperations)
|
||||
caches.forEach { it.cleanDirtyInlineFunctions() }
|
||||
|
||||
return ADDITIONAL_PASS_REQUIRED
|
||||
}
|
||||
|
||||
private fun processChanges(
|
||||
compiledFiles: Collection<File>,
|
||||
compiledFiles: Set<File>,
|
||||
allCompiledFiles: MutableSet<File>,
|
||||
dataManager: BuildDataManager,
|
||||
caches: List<IncrementalCacheImpl>,
|
||||
@@ -261,7 +262,7 @@ public class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR
|
||||
when {
|
||||
inlineAdded -> {
|
||||
allCompiledFiles.clear()
|
||||
fsOperations.markChunk(recursively = true)
|
||||
fsOperations.markChunk(recursively = true, excludeFiles = compiledFiles)
|
||||
return
|
||||
}
|
||||
constantsChanged -> {
|
||||
@@ -275,7 +276,7 @@ public class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR
|
||||
|
||||
if (inlineChanged) {
|
||||
for (cache in caches) {
|
||||
fsOperations.markFiles(cache.getFilesToReinline())
|
||||
fsOperations.markFiles(cache.getFilesToReinline(), excludeFiles = compiledFiles)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -291,20 +292,14 @@ public class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR
|
||||
|
||||
if (change !is ChangeInfo.MembersChanged) continue
|
||||
|
||||
val files = change.names
|
||||
.flatMap { lookupStorage.get(LookupSymbol(it, change.fqName.asString())) }
|
||||
.asSequence()
|
||||
.map { File(it) }
|
||||
.filter { it !in compiledFiles && it.exists() }
|
||||
.toList()
|
||||
val files = change.names.asSequence()
|
||||
.flatMap { lookupStorage.get(LookupSymbol(it, change.fqName.asString())).asSequence() }
|
||||
.map(::File)
|
||||
|
||||
LOG.debug("Mark dirty files: $files")
|
||||
fsOperations.markFiles(files)
|
||||
fsOperations.markFiles(files.asIterable(), excludeFiles = compiledFiles)
|
||||
}
|
||||
|
||||
LOG.debug("End of processing changes")
|
||||
|
||||
caches.forEach { it.cleanDirtyInlineFunctions() }
|
||||
}
|
||||
|
||||
if (IncrementalCompilation.isExperimental()) {
|
||||
|
||||
@@ -131,7 +131,6 @@ public class IncrementalCacheImpl(
|
||||
dependents.forEach(::addFilesAffectedByChangedInlineFuns)
|
||||
}
|
||||
|
||||
cleanDirtyInlineFunctions()
|
||||
return result.map { File(it) }
|
||||
}
|
||||
|
||||
|
||||
+12
@@ -377,12 +377,24 @@ public class ExperimentalIncrementalJpsTestGenerated extends AbstractExperimenta
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("inlineModifiedWithUsage")
|
||||
public void testInlineModifiedWithUsage() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/inlineModifiedWithUsage/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("inlineTwoFunctionsOneChanged")
|
||||
public void testInlineTwoFunctionsOneChanged() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/inlineTwoFunctionsOneChanged/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("inlineUsedWhereDeclared")
|
||||
public void testInlineUsedWhereDeclared() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/inlineUsedWhereDeclared/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("internalClassChanged")
|
||||
public void testInternalClassChanged() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/internalClassChanged/");
|
||||
|
||||
@@ -377,12 +377,24 @@ public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("inlineModifiedWithUsage")
|
||||
public void testInlineModifiedWithUsage() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/inlineModifiedWithUsage/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("inlineTwoFunctionsOneChanged")
|
||||
public void testInlineTwoFunctionsOneChanged() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/inlineTwoFunctionsOneChanged/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("inlineUsedWhereDeclared")
|
||||
public void testInlineUsedWhereDeclared() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/inlineUsedWhereDeclared/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("internalClassChanged")
|
||||
public void testInternalClassChanged() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/internalClassChanged/");
|
||||
|
||||
@@ -7,9 +7,7 @@ End of files
|
||||
Cleaning output files:
|
||||
out/production/module/X$main$1.class
|
||||
out/production/module/X.class
|
||||
out/production/module/Y.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/fun.kt
|
||||
src/usage.kt
|
||||
End of files
|
||||
End of files
|
||||
@@ -0,0 +1,9 @@
|
||||
Cleaning output files:
|
||||
out/production/module/META-INF/module.kotlin_module
|
||||
out/production/module/foo/InlineKt.class
|
||||
out/production/module/foo/UsageKt.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/inline.kt
|
||||
src/usage.kt
|
||||
End of files
|
||||
@@ -0,0 +1,3 @@
|
||||
package foo
|
||||
|
||||
inline fun f(): Int = 0
|
||||
@@ -0,0 +1,3 @@
|
||||
package foo
|
||||
|
||||
inline fun f(): Int = 1
|
||||
@@ -0,0 +1,5 @@
|
||||
package foo
|
||||
|
||||
fun useF() {
|
||||
println(f())
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package foo
|
||||
|
||||
fun useF() {
|
||||
println(f())
|
||||
println(f())
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
Cleaning output files:
|
||||
out/production/module/META-INF/module.kotlin_module
|
||||
out/production/module/foo/InlineKt.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/inline.kt
|
||||
End of files
|
||||
|
||||
|
||||
Cleaning output files:
|
||||
out/production/module/META-INF/module.kotlin_module
|
||||
out/production/module/foo/InlineKt.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/inline.kt
|
||||
End of files
|
||||
@@ -0,0 +1,7 @@
|
||||
package foo
|
||||
|
||||
fun test() {
|
||||
println(f())
|
||||
}
|
||||
|
||||
inline fun f(): Int = 0
|
||||
@@ -0,0 +1,7 @@
|
||||
package foo
|
||||
|
||||
fun test() {
|
||||
println(f())
|
||||
}
|
||||
|
||||
inline fun f(): Int = 1
|
||||
@@ -0,0 +1,9 @@
|
||||
package foo
|
||||
|
||||
fun test() {
|
||||
println(f())
|
||||
println(g())
|
||||
}
|
||||
|
||||
inline fun f(): Int = 1
|
||||
inline fun g(): Int = 1
|
||||
Reference in New Issue
Block a user