From cdcc588a551a96f86d2ab30608b71bbc65ded69a Mon Sep 17 00:00:00 2001 From: Sergey Rostov Date: Fri, 31 Aug 2018 13:17:05 +0300 Subject: [PATCH] IC: Fix CacheVersionsManager IC flag set. Previously flag was set before the IncrementalCompilation.isEnabledForJvm() system property was set. This cases that the cache versions was not saved. --- .../kotlin/incremental/IncrementalJsCompilerRunner.kt | 4 ++-- .../kotlin/incremental/IncrementalJvmCompilerRunner.kt | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/compiler/incremental-compilation-impl/src/org/jetbrains/kotlin/incremental/IncrementalJsCompilerRunner.kt b/compiler/incremental-compilation-impl/src/org/jetbrains/kotlin/incremental/IncrementalJsCompilerRunner.kt index f52340db28d..ff7bfcf7e27 100644 --- a/compiler/incremental-compilation-impl/src/org/jetbrains/kotlin/incremental/IncrementalJsCompilerRunner.kt +++ b/compiler/incremental-compilation-impl/src/org/jetbrains/kotlin/incremental/IncrementalJsCompilerRunner.kt @@ -38,13 +38,13 @@ fun makeJsIncrementally( messageCollector: MessageCollector = MessageCollector.NONE, reporter: ICReporter = EmptyICReporter ) { - val isIncremental = IncrementalCompilation.isEnabledForJs() - val versions = commonCacheVersionsManagers(cachesDir, isIncremental) + standaloneCacheVersionManager(cachesDir, isIncremental) val allKotlinFiles = sourceRoots.asSequence().flatMap { it.walk() } .filter { it.isFile && it.extension.equals("kt", ignoreCase = true) }.toList() val buildHistoryFile = File(cachesDir, "build-history.bin") withJsIC { + val versions = commonCacheVersionsManagers(cachesDir, true) + standaloneCacheVersionManager(cachesDir, true) + val compiler = IncrementalJsCompilerRunner( cachesDir, versions, reporter, buildHistoryFile = buildHistoryFile, diff --git a/compiler/incremental-compilation-impl/src/org/jetbrains/kotlin/incremental/IncrementalJvmCompilerRunner.kt b/compiler/incremental-compilation-impl/src/org/jetbrains/kotlin/incremental/IncrementalJvmCompilerRunner.kt index d5dc22e70a1..c100b729249 100644 --- a/compiler/incremental-compilation-impl/src/org/jetbrains/kotlin/incremental/IncrementalJvmCompilerRunner.kt +++ b/compiler/incremental-compilation-impl/src/org/jetbrains/kotlin/incremental/IncrementalJvmCompilerRunner.kt @@ -57,9 +57,6 @@ fun makeIncrementally( messageCollector: MessageCollector = MessageCollector.NONE, reporter: ICReporter = EmptyICReporter ) { - val isIncremental = IncrementalCompilation.isEnabledForJvm() - val versions = commonCacheVersionsManagers(cachesDir, isIncremental) + standaloneCacheVersionManager(cachesDir, isIncremental) - val kotlinExtensions = listOf("kt", "kts") val allExtensions = kotlinExtensions + listOf("java") val rootsWalk = sourceRoots.asSequence().flatMap { it.walk() } @@ -68,6 +65,8 @@ fun makeIncrementally( val buildHistoryFile = File(cachesDir, "build-history.bin") withIC { + val versions = commonCacheVersionsManagers(cachesDir, true) + standaloneCacheVersionManager(cachesDir, true) + val compiler = IncrementalJvmCompilerRunner( cachesDir, sourceRoots.map { JvmSourceRoot(it, null) }.toSet(),