Skip to content

Commit

Permalink
[JPS] Add an option to enable lookup map generation in JPS dumb mode
Browse files Browse the repository at this point in the history
A new system property has been introduced to enable lookup storage fulfilling when JPS dumb mode is enabled, making it possible not to break compatibility with the compiler reference index storage feature in the new JPS graph implementation.

^KTIJ-30296 Fixed

Merge-request: KT-MR-16515
Merged-by: Aleksei Cherepanov <[email protected]>
(cherry picked from commit e46d2de)
  • Loading branch information
Aleksei.Cherepanov committed Jun 26, 2024
1 parent 60eb01a commit 3dcabe1
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions jps/jps-plugin/src/org/jetbrains/kotlin/jps/build/KotlinBuilder.kt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {

val useDependencyGraph = System.getProperty("jps.use.dependency.graph", "false")!!.toBoolean()
val isKotlinBuilderInDumbMode = System.getProperty("kotlin.jps.dumb.mode", "false")!!.toBoolean()
val enableLookupStorageFillingInDumbMode = System.getProperty("kotlin.jps.enable.lookups.in.dumb.mode", "false")!!.toBoolean()

private val classesToLoadByParentFromRegistry =
System.getProperty("kotlin.jps.classesToLoadByParent")?.split(',')?.map { it.trim() } ?: emptyList()
Expand Down Expand Up @@ -532,17 +533,17 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
)
}

if (!isKotlinBuilderInDumbMode) {
if (!isKotlinBuilderInDumbMode || enableLookupStorageFillingInDumbMode) {
updateLookupStorage(lookupTracker, kotlinContext.lookupStorageManager, kotlinDirtyFilesHolder)
}

if (!isChunkRebuilding) {
changesCollector.processChangesUsingLookups(
kotlinDirtyFilesHolder.allDirtyFiles,
kotlinContext.lookupStorageManager,
fsOperations,
incrementalCaches.values
)
}
if (!isKotlinBuilderInDumbMode && !isChunkRebuilding) {
changesCollector.processChangesUsingLookups(
kotlinDirtyFilesHolder.allDirtyFiles,
kotlinContext.lookupStorageManager,
fsOperations,
incrementalCaches.values
)
}
}

Expand Down

0 comments on commit 3dcabe1

Please sign in to comment.