Remove old IC: remove experimental cache version
This commit is contained in:
@@ -24,11 +24,9 @@ import java.io.File
|
|||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
|
|
||||||
private val NORMAL_VERSION = 8
|
private val NORMAL_VERSION = 8
|
||||||
private val EXPERIMENTAL_VERSION = 4
|
|
||||||
private val DATA_CONTAINER_VERSION = 2
|
private val DATA_CONTAINER_VERSION = 2
|
||||||
|
|
||||||
private val NORMAL_VERSION_FILE_NAME = "format-version.txt"
|
private val NORMAL_VERSION_FILE_NAME = "format-version.txt"
|
||||||
private val EXPERIMENTAL_VERSION_FILE_NAME = "experimental-format-version.txt"
|
|
||||||
private val DATA_CONTAINER_VERSION_FILE_NAME = "data-container-format-version.txt"
|
private val DATA_CONTAINER_VERSION_FILE_NAME = "data-container-format-version.txt"
|
||||||
|
|
||||||
class CacheVersion(
|
class CacheVersion(
|
||||||
@@ -92,7 +90,6 @@ class CacheVersion(
|
|||||||
REBUILD_ALL_KOTLIN,
|
REBUILD_ALL_KOTLIN,
|
||||||
REBUILD_CHUNK,
|
REBUILD_CHUNK,
|
||||||
CLEAN_NORMAL_CACHES,
|
CLEAN_NORMAL_CACHES,
|
||||||
CLEAN_EXPERIMENTAL_CACHES,
|
|
||||||
CLEAN_DATA_CONTAINER,
|
CLEAN_DATA_CONTAINER,
|
||||||
DO_NOTHING
|
DO_NOTHING
|
||||||
}
|
}
|
||||||
@@ -106,14 +103,6 @@ fun normalCacheVersion(dataRoot: File): CacheVersion =
|
|||||||
whenTurnedOff = CacheVersion.Action.CLEAN_NORMAL_CACHES,
|
whenTurnedOff = CacheVersion.Action.CLEAN_NORMAL_CACHES,
|
||||||
isEnabled = { IncrementalCompilation.isEnabled() })
|
isEnabled = { IncrementalCompilation.isEnabled() })
|
||||||
|
|
||||||
fun experimentalCacheVersion(dataRoot: File): CacheVersion =
|
|
||||||
CacheVersion(ownVersion = EXPERIMENTAL_VERSION,
|
|
||||||
versionFile = File(dataRoot, EXPERIMENTAL_VERSION_FILE_NAME),
|
|
||||||
whenVersionChanged = CacheVersion.Action.REBUILD_CHUNK,
|
|
||||||
whenTurnedOn = CacheVersion.Action.REBUILD_CHUNK,
|
|
||||||
whenTurnedOff = CacheVersion.Action.CLEAN_EXPERIMENTAL_CACHES,
|
|
||||||
isEnabled = { IncrementalCompilation.isEnabled() })
|
|
||||||
|
|
||||||
fun dataContainerCacheVersion(dataRoot: File): CacheVersion =
|
fun dataContainerCacheVersion(dataRoot: File): CacheVersion =
|
||||||
CacheVersion(ownVersion = DATA_CONTAINER_VERSION,
|
CacheVersion(ownVersion = DATA_CONTAINER_VERSION,
|
||||||
versionFile = File(dataRoot, DATA_CONTAINER_VERSION_FILE_NAME),
|
versionFile = File(dataRoot, DATA_CONTAINER_VERSION_FILE_NAME),
|
||||||
|
|||||||
@@ -73,12 +73,6 @@ open class IncrementalCacheImpl<Target>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private val baseDir = File(targetDataRoot, KOTLIN_CACHE_DIRECTORY_NAME)
|
private val baseDir = File(targetDataRoot, KOTLIN_CACHE_DIRECTORY_NAME)
|
||||||
private val experimentalMaps = arrayListOf<BasicMap<*, *>>()
|
|
||||||
|
|
||||||
private fun <K, V, M : BasicMap<K, V>> registerExperimentalMap(map: M): M {
|
|
||||||
experimentalMaps.add(map)
|
|
||||||
return registerMap(map)
|
|
||||||
}
|
|
||||||
|
|
||||||
protected val String.storageFile: File
|
protected val String.storageFile: File
|
||||||
get() = File(baseDir, this + "." + CACHE_EXTENSION)
|
get() = File(baseDir, this + "." + CACHE_EXTENSION)
|
||||||
@@ -91,11 +85,11 @@ open class IncrementalCacheImpl<Target>(
|
|||||||
private val sourceToClassesMap = registerMap(SourceToClassesMap(SOURCE_TO_CLASSES.storageFile))
|
private val sourceToClassesMap = registerMap(SourceToClassesMap(SOURCE_TO_CLASSES.storageFile))
|
||||||
private val dirtyOutputClassesMap = registerMap(DirtyOutputClassesMap(DIRTY_OUTPUT_CLASSES.storageFile))
|
private val dirtyOutputClassesMap = registerMap(DirtyOutputClassesMap(DIRTY_OUTPUT_CLASSES.storageFile))
|
||||||
private val inlineFunctionsMap = registerMap(InlineFunctionsMap(INLINE_FUNCTIONS.storageFile))
|
private val inlineFunctionsMap = registerMap(InlineFunctionsMap(INLINE_FUNCTIONS.storageFile))
|
||||||
private val subtypesMap = registerExperimentalMap(SubtypesMap(SUBTYPES.storageFile))
|
private val subtypesMap = registerMap(SubtypesMap(SUBTYPES.storageFile))
|
||||||
private val supertypesMap = registerExperimentalMap(SupertypesMap(SUPERTYPES.storageFile))
|
private val supertypesMap = registerMap(SupertypesMap(SUPERTYPES.storageFile))
|
||||||
private val classFqNameToSourceMap = registerExperimentalMap(ClassFqNameToSourceMap(CLASS_FQ_NAME_TO_SOURCE.storageFile))
|
private val classFqNameToSourceMap = registerMap(ClassFqNameToSourceMap(CLASS_FQ_NAME_TO_SOURCE.storageFile))
|
||||||
// todo: try to use internal names only?
|
// todo: try to use internal names only?
|
||||||
private val internalNameToSource = registerExperimentalMap(InternalNameToSourcesMap(INTERNAL_NAME_TO_SOURCE.storageFile))
|
private val internalNameToSource = registerMap(InternalNameToSourcesMap(INTERNAL_NAME_TO_SOURCE.storageFile))
|
||||||
|
|
||||||
private val dependents = arrayListOf<IncrementalCacheImpl<Target>>()
|
private val dependents = arrayListOf<IncrementalCacheImpl<Target>>()
|
||||||
private val outputDir by lazy(LazyThreadSafetyMode.NONE) { requireNotNull(targetOutputDir) { "Target is expected to have output directory: $target" } }
|
private val outputDir by lazy(LazyThreadSafetyMode.NONE) { requireNotNull(targetOutputDir) { "Target is expected to have output directory: $target" } }
|
||||||
@@ -365,12 +359,6 @@ open class IncrementalCacheImpl<Target>(
|
|||||||
override fun clean() {
|
override fun clean() {
|
||||||
super.clean()
|
super.clean()
|
||||||
normalCacheVersion(targetDataRoot).clean()
|
normalCacheVersion(targetDataRoot).clean()
|
||||||
experimentalCacheVersion(targetDataRoot).clean()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun cleanExperimental() {
|
|
||||||
experimentalCacheVersion(targetDataRoot).clean()
|
|
||||||
experimentalMaps.forEach { it.clean() }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private inner class ProtoMap(storageFile: File) : BasicStringMap<ProtoMapValue>(storageFile, ProtoMapValueExternalizer) {
|
private inner class ProtoMap(storageFile: File) : BasicStringMap<ProtoMapValue>(storageFile, ProtoMapValueExternalizer) {
|
||||||
|
|||||||
-1
@@ -35,5 +35,4 @@ fun customCacheVersion(version: Int, fileName: String, dataRoot: File, forceEnab
|
|||||||
|
|
||||||
fun commonCacheVersions(cachesDir: File): List<CacheVersion> =
|
fun commonCacheVersions(cachesDir: File): List<CacheVersion> =
|
||||||
listOf(normalCacheVersion(cachesDir),
|
listOf(normalCacheVersion(cachesDir),
|
||||||
experimentalCacheVersion(cachesDir),
|
|
||||||
dataContainerCacheVersion(cachesDir))
|
dataContainerCacheVersion(cachesDir))
|
||||||
-1
@@ -82,7 +82,6 @@ abstract class AbstractIncrementalLazyCachesTest : AbstractIncrementalJpsTest()
|
|||||||
val jvmMetaBuildInfo = jvmBuildMetaInfoFile(target, dataManager)
|
val jvmMetaBuildInfo = jvmBuildMetaInfoFile(target, dataManager)
|
||||||
dumpCachesForTarget(p, paths, target,
|
dumpCachesForTarget(p, paths, target,
|
||||||
versions.normalVersion(target).formatVersionFile,
|
versions.normalVersion(target).formatVersionFile,
|
||||||
versions.experimentalVersion(target).formatVersionFile,
|
|
||||||
jvmMetaBuildInfo,
|
jvmMetaBuildInfo,
|
||||||
subdirectory = KOTLIN_CACHE_DIRECTORY_NAME)
|
subdirectory = KOTLIN_CACHE_DIRECTORY_NAME)
|
||||||
}
|
}
|
||||||
|
|||||||
-2
@@ -23,8 +23,6 @@ import org.jetbrains.kotlin.jps.incremental.CacheVersionProvider
|
|||||||
abstract class AbstractExperimentalIncrementalJpsTest : AbstractIncrementalJpsTest()
|
abstract class AbstractExperimentalIncrementalJpsTest : AbstractIncrementalJpsTest()
|
||||||
|
|
||||||
abstract class AbstractExperimentalIncrementalCacheVersionChangedTest : AbstractIncrementalCacheVersionChangedTest() {
|
abstract class AbstractExperimentalIncrementalCacheVersionChangedTest : AbstractIncrementalCacheVersionChangedTest() {
|
||||||
override fun getVersions(cacheVersionProvider: CacheVersionProvider, targets: Iterable<ModuleBuildTarget>) =
|
|
||||||
targets.map { cacheVersionProvider.experimentalVersion(it) }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class AbstractDataContainerVersionChangedTest : AbstractExperimentalIncrementalCacheVersionChangedTest() {
|
abstract class AbstractDataContainerVersionChangedTest : AbstractExperimentalIncrementalCacheVersionChangedTest() {
|
||||||
|
|||||||
@@ -370,13 +370,6 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
|
|||||||
dataManager.getKotlinCache(target).clean()
|
dataManager.getKotlinCache(target).clean()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CacheVersion.Action.CLEAN_EXPERIMENTAL_CACHES -> {
|
|
||||||
LOG.info("Clearing experimental caches for all targets")
|
|
||||||
|
|
||||||
for (target in allTargets) {
|
|
||||||
dataManager.getKotlinCache(target).cleanExperimental()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CacheVersion.Action.CLEAN_DATA_CONTAINER -> {
|
CacheVersion.Action.CLEAN_DATA_CONTAINER -> {
|
||||||
LOG.info("Clearing lookup cache")
|
LOG.info("Clearing lookup cache")
|
||||||
dataManager.getStorage(KotlinDataContainerTarget, JpsLookupStorageProvider).clean()
|
dataManager.getStorage(KotlinDataContainerTarget, JpsLookupStorageProvider).clean()
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import org.jetbrains.jps.builders.storage.BuildDataPaths
|
|||||||
import org.jetbrains.jps.incremental.ModuleBuildTarget
|
import org.jetbrains.jps.incremental.ModuleBuildTarget
|
||||||
import org.jetbrains.kotlin.incremental.CacheVersion
|
import org.jetbrains.kotlin.incremental.CacheVersion
|
||||||
import org.jetbrains.kotlin.incremental.dataContainerCacheVersion
|
import org.jetbrains.kotlin.incremental.dataContainerCacheVersion
|
||||||
import org.jetbrains.kotlin.incremental.experimentalCacheVersion
|
|
||||||
import org.jetbrains.kotlin.incremental.normalCacheVersion
|
import org.jetbrains.kotlin.incremental.normalCacheVersion
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
@@ -32,8 +31,6 @@ class CacheVersionProvider(private val paths: BuildDataPaths) {
|
|||||||
|
|
||||||
fun normalVersion(target: ModuleBuildTarget): CacheVersion = normalCacheVersion(target.dataRoot)
|
fun normalVersion(target: ModuleBuildTarget): CacheVersion = normalCacheVersion(target.dataRoot)
|
||||||
|
|
||||||
fun experimentalVersion(target: ModuleBuildTarget): CacheVersion = experimentalCacheVersion(target.dataRoot)
|
|
||||||
|
|
||||||
fun dataContainerVersion(): CacheVersion = dataContainerCacheVersion(KotlinDataContainerTarget.dataRoot)
|
fun dataContainerVersion(): CacheVersion = dataContainerCacheVersion(KotlinDataContainerTarget.dataRoot)
|
||||||
|
|
||||||
fun allVersions(targets: Iterable<ModuleBuildTarget>): Iterable<CacheVersion> {
|
fun allVersions(targets: Iterable<ModuleBuildTarget>): Iterable<CacheVersion> {
|
||||||
@@ -42,7 +39,6 @@ class CacheVersionProvider(private val paths: BuildDataPaths) {
|
|||||||
|
|
||||||
for (dataRoot in targets.map { it.dataRoot }) {
|
for (dataRoot in targets.map { it.dataRoot }) {
|
||||||
versions.add(normalCacheVersion(dataRoot))
|
versions.add(normalCacheVersion(dataRoot))
|
||||||
versions.add(experimentalCacheVersion(dataRoot))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return versions
|
return versions
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
================ Step #1 =================
|
================ Step #1 =================
|
||||||
|
|
||||||
Building module1
|
Building module1
|
||||||
Actions after cache changed: [CLEAN_NORMAL_CACHES, CLEAN_EXPERIMENTAL_CACHES, CLEAN_DATA_CONTAINER]
|
Actions after cache changed: [CLEAN_NORMAL_CACHES, CLEAN_DATA_CONTAINER]
|
||||||
Exit code: NOTHING_DONE
|
Exit code: NOTHING_DONE
|
||||||
------------------------------------------
|
------------------------------------------
|
||||||
Building module2
|
Building module2
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
================ Step #1 =================
|
================ Step #1 =================
|
||||||
|
|
||||||
Building module1
|
Building module1
|
||||||
Actions after cache changed: [CLEAN_NORMAL_CACHES, CLEAN_EXPERIMENTAL_CACHES, CLEAN_DATA_CONTAINER]
|
Actions after cache changed: [CLEAN_NORMAL_CACHES, CLEAN_DATA_CONTAINER]
|
||||||
Exit code: NOTHING_DONE
|
Exit code: NOTHING_DONE
|
||||||
------------------------------------------
|
------------------------------------------
|
||||||
Building module2
|
Building module2
|
||||||
|
|||||||
Vendored
-4
@@ -5,7 +5,6 @@ kotlin-data-container
|
|||||||
id-to-file.tab
|
id-to-file.tab
|
||||||
lookups.tab
|
lookups.tab
|
||||||
Module 'module1' production
|
Module 'module1' production
|
||||||
experimental-format-version.txt
|
|
||||||
format-version.txt
|
format-version.txt
|
||||||
jvm-build-meta-info.txt
|
jvm-build-meta-info.txt
|
||||||
class-fq-name-to-source.tab
|
class-fq-name-to-source.tab
|
||||||
@@ -14,7 +13,6 @@ Module 'module1' production
|
|||||||
source-to-classes.tab
|
source-to-classes.tab
|
||||||
Module 'module1' tests
|
Module 'module1' tests
|
||||||
Module 'module2' production
|
Module 'module2' production
|
||||||
experimental-format-version.txt
|
|
||||||
format-version.txt
|
format-version.txt
|
||||||
jvm-build-meta-info.txt
|
jvm-build-meta-info.txt
|
||||||
inline-functions.tab
|
inline-functions.tab
|
||||||
@@ -24,7 +22,6 @@ Module 'module2' production
|
|||||||
source-to-classes.tab
|
source-to-classes.tab
|
||||||
Module 'module2' tests
|
Module 'module2' tests
|
||||||
Module 'module3' production
|
Module 'module3' production
|
||||||
experimental-format-version.txt
|
|
||||||
format-version.txt
|
format-version.txt
|
||||||
jvm-build-meta-info.txt
|
jvm-build-meta-info.txt
|
||||||
class-fq-name-to-source.tab
|
class-fq-name-to-source.tab
|
||||||
@@ -33,7 +30,6 @@ Module 'module3' production
|
|||||||
source-to-classes.tab
|
source-to-classes.tab
|
||||||
Module 'module3' tests
|
Module 'module3' tests
|
||||||
Module 'module4' production
|
Module 'module4' production
|
||||||
experimental-format-version.txt
|
|
||||||
format-version.txt
|
format-version.txt
|
||||||
jvm-build-meta-info.txt
|
jvm-build-meta-info.txt
|
||||||
class-fq-name-to-source.tab
|
class-fq-name-to-source.tab
|
||||||
|
|||||||
-1
@@ -5,7 +5,6 @@ kotlin-data-container
|
|||||||
id-to-file.tab
|
id-to-file.tab
|
||||||
lookups.tab
|
lookups.tab
|
||||||
Module 'module' production
|
Module 'module' production
|
||||||
experimental-format-version.txt
|
|
||||||
format-version.txt
|
format-version.txt
|
||||||
jvm-build-meta-info.txt
|
jvm-build-meta-info.txt
|
||||||
class-fq-name-to-source.tab
|
class-fq-name-to-source.tab
|
||||||
|
|||||||
Vendored
-1
@@ -5,7 +5,6 @@ kotlin-data-container
|
|||||||
id-to-file.tab
|
id-to-file.tab
|
||||||
lookups.tab
|
lookups.tab
|
||||||
Module 'module' production
|
Module 'module' production
|
||||||
experimental-format-version.txt
|
|
||||||
format-version.txt
|
format-version.txt
|
||||||
jvm-build-meta-info.txt
|
jvm-build-meta-info.txt
|
||||||
class-fq-name-to-source.tab
|
class-fq-name-to-source.tab
|
||||||
|
|||||||
-1
@@ -5,7 +5,6 @@ kotlin-data-container
|
|||||||
id-to-file.tab
|
id-to-file.tab
|
||||||
lookups.tab
|
lookups.tab
|
||||||
Module 'module' production
|
Module 'module' production
|
||||||
experimental-format-version.txt
|
|
||||||
format-version.txt
|
format-version.txt
|
||||||
jvm-build-meta-info.txt
|
jvm-build-meta-info.txt
|
||||||
constants.tab
|
constants.tab
|
||||||
|
|||||||
-1
@@ -5,7 +5,6 @@ kotlin-data-container
|
|||||||
id-to-file.tab
|
id-to-file.tab
|
||||||
lookups.tab
|
lookups.tab
|
||||||
Module 'module' production
|
Module 'module' production
|
||||||
experimental-format-version.txt
|
|
||||||
format-version.txt
|
format-version.txt
|
||||||
jvm-build-meta-info.txt
|
jvm-build-meta-info.txt
|
||||||
internal-name-to-source.tab
|
internal-name-to-source.tab
|
||||||
|
|||||||
Vendored
-1
@@ -5,7 +5,6 @@ kotlin-data-container
|
|||||||
id-to-file.tab
|
id-to-file.tab
|
||||||
lookups.tab
|
lookups.tab
|
||||||
Module 'module' production
|
Module 'module' production
|
||||||
experimental-format-version.txt
|
|
||||||
format-version.txt
|
format-version.txt
|
||||||
jvm-build-meta-info.txt
|
jvm-build-meta-info.txt
|
||||||
inline-functions.tab
|
inline-functions.tab
|
||||||
|
|||||||
-1
@@ -5,7 +5,6 @@ kotlin-data-container
|
|||||||
id-to-file.tab
|
id-to-file.tab
|
||||||
lookups.tab
|
lookups.tab
|
||||||
Module 'module' production
|
Module 'module' production
|
||||||
experimental-format-version.txt
|
|
||||||
format-version.txt
|
format-version.txt
|
||||||
jvm-build-meta-info.txt
|
jvm-build-meta-info.txt
|
||||||
inline-functions.tab
|
inline-functions.tab
|
||||||
|
|||||||
Vendored
-1
@@ -5,7 +5,6 @@ kotlin-data-container
|
|||||||
id-to-file.tab
|
id-to-file.tab
|
||||||
lookups.tab
|
lookups.tab
|
||||||
Module 'module' production
|
Module 'module' production
|
||||||
experimental-format-version.txt
|
|
||||||
format-version.txt
|
format-version.txt
|
||||||
jvm-build-meta-info.txt
|
jvm-build-meta-info.txt
|
||||||
internal-name-to-source.tab
|
internal-name-to-source.tab
|
||||||
|
|||||||
-1
@@ -210,7 +210,6 @@ open class KotlinCompile : AbstractKotlinCompile<K2JVMCompilerArguments>(), Kotl
|
|||||||
get() = File(File(project.buildDir, KOTLIN_BUILD_DIR_NAME), name).apply { mkdirs() }
|
get() = File(File(project.buildDir, KOTLIN_BUILD_DIR_NAME), name).apply { mkdirs() }
|
||||||
private val cacheVersions by lazy {
|
private val cacheVersions by lazy {
|
||||||
listOf(normalCacheVersion(taskBuildDirectory),
|
listOf(normalCacheVersion(taskBuildDirectory),
|
||||||
experimentalCacheVersion(taskBuildDirectory),
|
|
||||||
dataContainerCacheVersion(taskBuildDirectory),
|
dataContainerCacheVersion(taskBuildDirectory),
|
||||||
gradleCacheVersion(taskBuildDirectory))
|
gradleCacheVersion(taskBuildDirectory))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user