IC: remove CacheVersionManager usages from build_common.

They are kept up to date but was never used.
This commit is contained in:
Sergey Rostov
2018-10-15 12:35:58 +03:00
parent 5232f080d6
commit 940861c245
8 changed files with 3 additions and 106 deletions
@@ -29,7 +29,6 @@ import org.jetbrains.kotlin.config.Services
import org.jetbrains.kotlin.incremental.components.ExpectActualTracker
import org.jetbrains.kotlin.incremental.components.LookupTracker
import org.jetbrains.kotlin.incremental.parsing.classesFqNames
import org.jetbrains.kotlin.incremental.storage.version.CacheVersionManager
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.progress.CompilationCanceledStatus
import java.io.File
@@ -41,7 +40,6 @@ abstract class IncrementalCompilerRunner<
>(
workingDir: File,
cacheDirName: String,
protected val cachesVersionManagers: List<CacheVersionManager>,
protected val reporter: ICReporter,
private val buildHistoryFile: File,
private val localStateDirs: Collection<File> = emptyList()
@@ -270,10 +268,6 @@ abstract class IncrementalCompilerRunner<
val dirtyData = DirtyData(buildDirtyLookupSymbols, buildDirtyFqNames)
processChangesAfterBuild(compilationMode, currentBuildInfo, dirtyData)
if (exitCode == ExitCode.OK) {
cachesVersionManagers.forEach { it.writeVersion() }
}
return exitCode
}
@@ -26,7 +26,6 @@ import org.jetbrains.kotlin.config.Services
import org.jetbrains.kotlin.incremental.components.ExpectActualTracker
import org.jetbrains.kotlin.incremental.components.LookupTracker
import org.jetbrains.kotlin.incremental.js.*
import org.jetbrains.kotlin.incremental.storage.version.CacheVersionManager
import org.jetbrains.kotlin.incremental.multiproject.EmptyModulesApiHistory
import org.jetbrains.kotlin.incremental.multiproject.ModulesApiHistory
import java.io.File
@@ -43,10 +42,8 @@ fun makeJsIncrementally(
val buildHistoryFile = File(cachesDir, "build-history.bin")
withJsIC {
val versions = commonCacheVersionsManagers(cachesDir, true) + standaloneCacheVersionManager(cachesDir, true)
val compiler = IncrementalJsCompilerRunner(
cachesDir, versions, reporter,
cachesDir, reporter,
buildHistoryFile = buildHistoryFile,
modulesApiHistory = EmptyModulesApiHistory)
compiler.compile(allKotlinFiles, args, messageCollector, providedChangedFiles = null)
@@ -66,14 +63,12 @@ inline fun <R> withJsIC(fn: () -> R): R {
class IncrementalJsCompilerRunner(
workingDir: File,
cachesVersionManagers: List<CacheVersionManager>,
reporter: ICReporter,
buildHistoryFile: File,
private val modulesApiHistory: ModulesApiHistory
) : IncrementalCompilerRunner<K2JSCompilerArguments, IncrementalJsCachesManager>(
workingDir,
"caches-js",
cachesVersionManagers,
reporter,
buildHistoryFile = buildHistoryFile
) {
@@ -65,12 +65,10 @@ 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(),
versions, reporter,
reporter,
// Use precise setting in case of non-Gradle build
usePreciseJavaTracking = true,
localStateDirs = emptyList(),
@@ -102,7 +100,6 @@ inline fun <R> withIC(enabled: Boolean = true, fn: ()->R): R {
class IncrementalJvmCompilerRunner(
workingDir: File,
private val javaSourceRoots: Set<JvmSourceRoot>,
cachesVersionManagers: List<CacheVersionManager>,
reporter: ICReporter,
private val usePreciseJavaTracking: Boolean,
buildHistoryFile: File,
@@ -112,7 +109,6 @@ class IncrementalJvmCompilerRunner(
) : IncrementalCompilerRunner<K2JVMCompilerArguments, IncrementalJvmCachesManager>(
workingDir,
"caches-jvm",
cachesVersionManagers,
reporter,
localStateDirs = localStateDirs,
buildHistoryFile = buildHistoryFile
@@ -1,40 +0,0 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.incremental
import org.jetbrains.kotlin.incremental.storage.version.CacheVersionManager
import org.jetbrains.kotlin.incremental.storage.version.localCacheVersionManager
import org.jetbrains.kotlin.incremental.storage.version.lookupsCacheVersionManager
import java.io.File
internal const val STANDALONE_CACHE_VERSION = 2
internal const val STANDALONE_VERSION_FILE_NAME = "standalone-ic-format-version.txt"
fun standaloneCacheVersionManager(dataRoot: File, enabled: Boolean): CacheVersionManager =
customCacheVersionManager(STANDALONE_CACHE_VERSION, STANDALONE_VERSION_FILE_NAME, dataRoot, enabled)
fun customCacheVersionManager(version: Int, fileName: String, dataRoot: File, enabled: Boolean): CacheVersionManager =
CacheVersionManager(
File(dataRoot, fileName),
if (enabled) version else null
)
fun commonCacheVersionsManagers(cachesDir: File, enabled: Boolean): List<CacheVersionManager> =
listOf(
localCacheVersionManager(cachesDir, enabled),
lookupsCacheVersionManager(cachesDir, enabled)
)