Skip to content

Commit 9012e67

Browse files
author
Aleksei.Cherepanov
committed
Add KotlinBuilder 'dumb mode' flag
A new system property was added to enable a 'dumb mode' for KotlinBuilder. In this mode it is possible to disable IC caches, but don't request rebuild And all IC trackers will still work ^KT-64305 Fixed Merge-request: KT-MR-13524 Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com> (cherry picked from commit 3e41faf)
1 parent 712e735 commit 9012e67

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalJpsTest.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import org.jetbrains.kotlin.cli.common.arguments.parseCommandLineArguments
3939
import org.jetbrains.kotlin.incremental.LookupSymbol
4040
import org.jetbrains.kotlin.incremental.testingUtils.*
4141
import org.jetbrains.kotlin.incremental.utils.TestLookupTracker
42+
import org.jetbrains.kotlin.jps.build.KotlinBuilder.Companion.useDependencyGraph
4243
import org.jetbrains.kotlin.jps.build.dependeciestxt.ModulesTxt
4344
import org.jetbrains.kotlin.jps.build.dependeciestxt.ModulesTxtBuilder
4445
import org.jetbrains.kotlin.jps.build.fixtures.EnableICFixture
@@ -617,7 +618,7 @@ private fun createMappingsDump(
617618
project: ProjectDescriptor,
618619
kotlinContext: KotlinCompileContext,
619620
lookupsDuringTest: Set<LookupSymbol>,
620-
) = if (System.getProperty("jps.use.dependency.graph", "false").toBoolean()) "" else
621+
) = if (useDependencyGraph) "" else
621622
createKotlinCachesDump(project, kotlinContext, lookupsDuringTest) + "\n\n\n" +
622623
createCommonMappingsDump(project) + "\n\n\n" +
623624
createJavaMappingsDump(project)

jps/jps-plugin/src/org/jetbrains/kotlin/jps/build/KotlinBuilder.kt

+4-1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
6262
const val SKIP_CACHE_VERSION_CHECK_PROPERTY = "kotlin.jps.skip.cache.version.check"
6363
const val JPS_KOTLIN_HOME_PROPERTY = "jps.kotlin.home"
6464

65+
val useDependencyGraph = System.getProperty("jps.use.dependency.graph", "false")!!.toBoolean()
66+
val isKotlinBuilderInDumbMode = System.getProperty("kotlin.jps.dumb.mode", "false")!!.toBoolean()
67+
6568
private val classesToLoadByParentFromRegistry =
6669
System.getProperty("kotlin.jps.classesToLoadByParent")?.split(',')?.map { it.trim() } ?: emptyList()
6770
private val classPrefixesToLoadByParentFromRegistry =
@@ -507,7 +510,7 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
507510
environment
508511
)
509512

510-
if (!representativeTarget.isIncrementalCompilationEnabled) {
513+
if (isKotlinBuilderInDumbMode || !representativeTarget.isIncrementalCompilationEnabled) {
511514
return OK
512515
}
513516

0 commit comments

Comments
 (0)