[JPS] Improve JPS dumb mode

For the correct work of the compiler, some maps should be fulfilled by the build system. In the first implementation of dumb mode for JPS all maps were disabled. Now flag was introduced to determine IC behavior: to collect data needed for the compiler's code generation and disable maps and IC analysis

^KT-65043 Fixed
This commit is contained in:
Aleksei.Cherepanov
2024-01-15 17:51:23 +01:00
committed by Space Team
parent 32bc2b55ed
commit 1e7e42baf2
6 changed files with 60 additions and 34 deletions
@@ -499,7 +499,7 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
val generatedFiles = getGeneratedFiles(context, chunk, environment.outputItemsCollector)
markDirtyComplementaryMultifileClasses(generatedFiles, kotlinContext, incrementalCaches, fsOperations)
if (!isKotlinBuilderInDumbMode) markDirtyComplementaryMultifileClasses(generatedFiles, kotlinContext, incrementalCaches, fsOperations)
val kotlinTargets = kotlinContext.targetsBinding
for ((target, outputItems) in generatedFiles) {
@@ -530,7 +530,7 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
environment
)
if (isKotlinBuilderInDumbMode || !representativeTarget.isIncrementalCompilationEnabled) {
if (!representativeTarget.isIncrementalCompilationEnabled) {
return OK
}
@@ -552,15 +552,17 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
)
}
updateLookupStorage(lookupTracker, kotlinContext.lookupStorageManager, kotlinDirtyFilesHolder)
if (!isKotlinBuilderInDumbMode) {
updateLookupStorage(lookupTracker, kotlinContext.lookupStorageManager, kotlinDirtyFilesHolder)
if (!isChunkRebuilding) {
changesCollector.processChangesUsingLookups(
kotlinDirtyFilesHolder.allDirtyFiles,
kotlinContext.lookupStorageManager,
fsOperations,
incrementalCaches.values
)
if (!isChunkRebuilding) {
changesCollector.processChangesUsingLookups(
kotlinDirtyFilesHolder.allDirtyFiles,
kotlinContext.lookupStorageManager,
fsOperations,
incrementalCaches.values
)
}
}
}
@@ -84,7 +84,8 @@ class KotlinCompileContext(val jpsContext: CompileContext) {
val icContext = IncrementalCompilationContext(
pathConverterForSourceFiles = fileToPathConverter,
pathConverterForOutputFiles = fileToPathConverter
pathConverterForOutputFiles = fileToPathConverter,
useCompilerMapsOnly = KotlinBuilder.isKotlinBuilderInDumbMode
)
val lookupStorageManager = JpsLookupStorageManager(dataManager, icContext)