[LL FIR] KTIJ-25096 Add option to exclude binaries when incrementing modification trackers
- In performance tests, modification trackers were incorrectly incremented between tests for binary modules even with library caches enabled. The new option `includeBinaryTrackers` can be used by performance tests to exclude binary modules.
This commit is contained in:
committed by
Space Team
parent
f0720c1d12
commit
d266f49c7c
+5
-2
@@ -72,9 +72,12 @@ public abstract class KotlinModificationTrackerFactory {
|
||||
*/
|
||||
public abstract fun createModuleStateTracker(module: KtModule): KtModuleStateTracker
|
||||
|
||||
|
||||
/**
|
||||
* Increments modification trackers to invalidate caches. If [includeBinaryTrackers] is `false`, binary module-related modification
|
||||
* trackers will not be incremented (such as library trackers, SDK tracker, built-ins tracker, and so on).
|
||||
*/
|
||||
@TestOnly
|
||||
public abstract fun incrementModificationsCount()
|
||||
public abstract fun incrementModificationsCount(includeBinaryTrackers: Boolean = true)
|
||||
|
||||
public companion object {
|
||||
public fun getService(project: Project): KotlinModificationTrackerFactory =
|
||||
|
||||
+8
-3
@@ -38,11 +38,16 @@ public class KotlinStaticModificationTrackerFactory : KotlinModificationTrackerF
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
override fun incrementModificationsCount() {
|
||||
override fun incrementModificationsCount(includeBinaryTrackers: Boolean) {
|
||||
projectWide.incModificationCount()
|
||||
librariesWide.incModificationCount()
|
||||
if (includeBinaryTrackers) {
|
||||
librariesWide.incModificationCount()
|
||||
}
|
||||
moduleOutOfBlock.values.forEach { it.incModificationCount() }
|
||||
moduleState.values.forEach { it.incModificationCount() }
|
||||
moduleState.entries.forEach { (ktModule, tracker) ->
|
||||
if (ktModule is KtBinaryModule && !includeBinaryTrackers) return@forEach
|
||||
tracker.incModificationCount()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user