Write cache version only if incremental compilation is enabled
Original commit: b6bbc4015b
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package org.jetbrains.kotlin.jps.incremental
|
||||
|
||||
import org.jetbrains.annotations.TestOnly
|
||||
import org.jetbrains.kotlin.config.IncrementalCompilation
|
||||
import org.jetbrains.kotlin.jps.build.KotlinBuilder
|
||||
import org.jetbrains.kotlin.load.java.JvmAbi
|
||||
import java.io.File
|
||||
@@ -37,6 +38,7 @@ class CacheFormatVersion(targetDataRoot: File) {
|
||||
private val file = File(targetDataRoot, FORMAT_VERSION_FILE_PATH)
|
||||
|
||||
fun isIncompatible(): Boolean {
|
||||
assert(IncrementalCompilation.ENABLED) { "Incremental compilation is not enabled" }
|
||||
if (!file.exists()) return false
|
||||
|
||||
val versionNumber = file.readText().toInt()
|
||||
|
||||
+7
@@ -17,8 +17,10 @@
|
||||
package org.jetbrains.kotlin.jps.build
|
||||
|
||||
import com.intellij.testFramework.UsefulTestCase
|
||||
import org.jetbrains.kotlin.config.IncrementalCompilation
|
||||
import org.jetbrains.kotlin.jps.incremental.IncrementalCacheImpl
|
||||
import org.jetbrains.kotlin.jps.incremental.getCacheDirectoryName
|
||||
import org.jetbrains.kotlin.jps.incremental.getKotlinCacheVersion
|
||||
import org.jetbrains.kotlin.utils.Printer
|
||||
import java.io.File
|
||||
|
||||
@@ -41,6 +43,11 @@ public abstract class AbstractIncrementalLazyCachesTest : AbstractIncrementalJps
|
||||
p.println(target)
|
||||
p.pushIndent()
|
||||
|
||||
val cacheVersion = paths.getKotlinCacheVersion(target)
|
||||
if (cacheVersion.formatVersionFile.exists()) {
|
||||
p.println(cacheVersion.formatVersionFile.name)
|
||||
}
|
||||
|
||||
val dataRoot = paths.getTargetDataRoot(target)
|
||||
val cacheNames = kotlinCacheNames(dataRoot)
|
||||
cacheNames.sorted().forEach { p.println(it) }
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
Module 'module' production
|
||||
format-version.txt
|
||||
proto.tab
|
||||
source-to-classes.tab
|
||||
Module 'module' tests
|
||||
format-version.txt
|
||||
+2
@@ -1,5 +1,7 @@
|
||||
Module 'module' production
|
||||
format-version.txt
|
||||
package-parts.tab
|
||||
proto.tab
|
||||
source-to-classes.tab
|
||||
Module 'module' tests
|
||||
format-version.txt
|
||||
+2
@@ -1,6 +1,8 @@
|
||||
Module 'module' production
|
||||
format-version.txt
|
||||
inline-functions.tab
|
||||
package-parts.tab
|
||||
proto.tab
|
||||
source-to-classes.tab
|
||||
Module 'module' tests
|
||||
format-version.txt
|
||||
+2
@@ -1,7 +1,9 @@
|
||||
Module 'module' production
|
||||
format-version.txt
|
||||
inline-functions.tab
|
||||
inlined-to.tab
|
||||
package-parts.tab
|
||||
proto.tab
|
||||
source-to-classes.tab
|
||||
Module 'module' tests
|
||||
format-version.txt
|
||||
Reference in New Issue
Block a user