From 534db2d45b750b83d692b6d9f9dab4e0027fb954 Mon Sep 17 00:00:00 2001 From: Alexey Tsvetkov Date: Tue, 2 May 2017 19:39:32 +0300 Subject: [PATCH] Remove old IC: remove experimental cache version --- .../kotlin/incremental/CacheVersion.kt | 11 ---------- .../incremental/IncrementalCacheImpl.kt | 20 ++++--------------- .../kotlin/incremental/cacheVersions.kt | 1 - .../AbstractIncrementalLazyCachesTest.kt | 1 - ...experimentalIncrementalCompilationTests.kt | 2 -- .../kotlin/jps/build/KotlinBuilder.kt | 7 ------- .../jps/incremental/CacheVersionProvider.kt | 4 ---- .../incrementalOff/build.log | 2 +- .../incrementalOffOn/build.log | 2 +- .../expected-kotlin-caches.txt | 4 ---- .../class/expected-kotlin-caches.txt | 1 - .../expected-kotlin-caches.txt | 1 - .../constant/expected-kotlin-caches.txt | 1 - .../function/expected-kotlin-caches.txt | 1 - .../expected-kotlin-caches.txt | 1 - .../expected-kotlin-caches.txt | 1 - .../expected-kotlin-caches.txt | 1 - .../jetbrains/kotlin/gradle/tasks/Tasks.kt | 1 - 18 files changed, 6 insertions(+), 56 deletions(-) diff --git a/build-common/src/org/jetbrains/kotlin/incremental/CacheVersion.kt b/build-common/src/org/jetbrains/kotlin/incremental/CacheVersion.kt index 73d93a240f7..724ce00e06a 100644 --- a/build-common/src/org/jetbrains/kotlin/incremental/CacheVersion.kt +++ b/build-common/src/org/jetbrains/kotlin/incremental/CacheVersion.kt @@ -24,11 +24,9 @@ import java.io.File import java.io.IOException private val NORMAL_VERSION = 8 -private val EXPERIMENTAL_VERSION = 4 private val DATA_CONTAINER_VERSION = 2 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" class CacheVersion( @@ -92,7 +90,6 @@ class CacheVersion( REBUILD_ALL_KOTLIN, REBUILD_CHUNK, CLEAN_NORMAL_CACHES, - CLEAN_EXPERIMENTAL_CACHES, CLEAN_DATA_CONTAINER, DO_NOTHING } @@ -106,14 +103,6 @@ fun normalCacheVersion(dataRoot: File): CacheVersion = whenTurnedOff = CacheVersion.Action.CLEAN_NORMAL_CACHES, 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 = CacheVersion(ownVersion = DATA_CONTAINER_VERSION, versionFile = File(dataRoot, DATA_CONTAINER_VERSION_FILE_NAME), diff --git a/build-common/src/org/jetbrains/kotlin/incremental/IncrementalCacheImpl.kt b/build-common/src/org/jetbrains/kotlin/incremental/IncrementalCacheImpl.kt index 64caad9f928..ec91bde4136 100644 --- a/build-common/src/org/jetbrains/kotlin/incremental/IncrementalCacheImpl.kt +++ b/build-common/src/org/jetbrains/kotlin/incremental/IncrementalCacheImpl.kt @@ -73,12 +73,6 @@ open class IncrementalCacheImpl( } private val baseDir = File(targetDataRoot, KOTLIN_CACHE_DIRECTORY_NAME) - private val experimentalMaps = arrayListOf>() - - private fun > registerExperimentalMap(map: M): M { - experimentalMaps.add(map) - return registerMap(map) - } protected val String.storageFile: File get() = File(baseDir, this + "." + CACHE_EXTENSION) @@ -91,11 +85,11 @@ open class IncrementalCacheImpl( private val sourceToClassesMap = registerMap(SourceToClassesMap(SOURCE_TO_CLASSES.storageFile)) private val dirtyOutputClassesMap = registerMap(DirtyOutputClassesMap(DIRTY_OUTPUT_CLASSES.storageFile)) private val inlineFunctionsMap = registerMap(InlineFunctionsMap(INLINE_FUNCTIONS.storageFile)) - private val subtypesMap = registerExperimentalMap(SubtypesMap(SUBTYPES.storageFile)) - private val supertypesMap = registerExperimentalMap(SupertypesMap(SUPERTYPES.storageFile)) - private val classFqNameToSourceMap = registerExperimentalMap(ClassFqNameToSourceMap(CLASS_FQ_NAME_TO_SOURCE.storageFile)) + private val subtypesMap = registerMap(SubtypesMap(SUBTYPES.storageFile)) + private val supertypesMap = registerMap(SupertypesMap(SUPERTYPES.storageFile)) + private val classFqNameToSourceMap = registerMap(ClassFqNameToSourceMap(CLASS_FQ_NAME_TO_SOURCE.storageFile)) // 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>() private val outputDir by lazy(LazyThreadSafetyMode.NONE) { requireNotNull(targetOutputDir) { "Target is expected to have output directory: $target" } } @@ -365,12 +359,6 @@ open class IncrementalCacheImpl( override fun clean() { super.clean() normalCacheVersion(targetDataRoot).clean() - experimentalCacheVersion(targetDataRoot).clean() - } - - fun cleanExperimental() { - experimentalCacheVersion(targetDataRoot).clean() - experimentalMaps.forEach { it.clean() } } private inner class ProtoMap(storageFile: File) : BasicStringMap(storageFile, ProtoMapValueExternalizer) { diff --git a/compiler/incremental-compilation-impl/src/org/jetbrains/kotlin/incremental/cacheVersions.kt b/compiler/incremental-compilation-impl/src/org/jetbrains/kotlin/incremental/cacheVersions.kt index 6b14b1c3a8c..2dcc094c3e5 100644 --- a/compiler/incremental-compilation-impl/src/org/jetbrains/kotlin/incremental/cacheVersions.kt +++ b/compiler/incremental-compilation-impl/src/org/jetbrains/kotlin/incremental/cacheVersions.kt @@ -35,5 +35,4 @@ fun customCacheVersion(version: Int, fileName: String, dataRoot: File, forceEnab fun commonCacheVersions(cachesDir: File): List = listOf(normalCacheVersion(cachesDir), - experimentalCacheVersion(cachesDir), dataContainerCacheVersion(cachesDir)) \ No newline at end of file diff --git a/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalLazyCachesTest.kt b/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalLazyCachesTest.kt index fe75a143380..f850f07cd81 100644 --- a/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalLazyCachesTest.kt +++ b/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractIncrementalLazyCachesTest.kt @@ -82,7 +82,6 @@ abstract class AbstractIncrementalLazyCachesTest : AbstractIncrementalJpsTest() val jvmMetaBuildInfo = jvmBuildMetaInfoFile(target, dataManager) dumpCachesForTarget(p, paths, target, versions.normalVersion(target).formatVersionFile, - versions.experimentalVersion(target).formatVersionFile, jvmMetaBuildInfo, subdirectory = KOTLIN_CACHE_DIRECTORY_NAME) } diff --git a/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/experimentalIncrementalCompilationTests.kt b/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/experimentalIncrementalCompilationTests.kt index 795ad568754..c9fc3f70338 100644 --- a/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/experimentalIncrementalCompilationTests.kt +++ b/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/experimentalIncrementalCompilationTests.kt @@ -23,8 +23,6 @@ import org.jetbrains.kotlin.jps.incremental.CacheVersionProvider abstract class AbstractExperimentalIncrementalJpsTest : AbstractIncrementalJpsTest() abstract class AbstractExperimentalIncrementalCacheVersionChangedTest : AbstractIncrementalCacheVersionChangedTest() { - override fun getVersions(cacheVersionProvider: CacheVersionProvider, targets: Iterable) = - targets.map { cacheVersionProvider.experimentalVersion(it) } } abstract class AbstractDataContainerVersionChangedTest : AbstractExperimentalIncrementalCacheVersionChangedTest() { diff --git a/jps-plugin/src/org/jetbrains/kotlin/jps/build/KotlinBuilder.kt b/jps-plugin/src/org/jetbrains/kotlin/jps/build/KotlinBuilder.kt index 1568b9ffe45..2ea6f1db364 100644 --- a/jps-plugin/src/org/jetbrains/kotlin/jps/build/KotlinBuilder.kt +++ b/jps-plugin/src/org/jetbrains/kotlin/jps/build/KotlinBuilder.kt @@ -370,13 +370,6 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) { 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 -> { LOG.info("Clearing lookup cache") dataManager.getStorage(KotlinDataContainerTarget, JpsLookupStorageProvider).clean() diff --git a/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/CacheVersionProvider.kt b/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/CacheVersionProvider.kt index 31696d0f7f0..c99186a839f 100644 --- a/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/CacheVersionProvider.kt +++ b/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/CacheVersionProvider.kt @@ -21,7 +21,6 @@ import org.jetbrains.jps.builders.storage.BuildDataPaths import org.jetbrains.jps.incremental.ModuleBuildTarget import org.jetbrains.kotlin.incremental.CacheVersion import org.jetbrains.kotlin.incremental.dataContainerCacheVersion -import org.jetbrains.kotlin.incremental.experimentalCacheVersion import org.jetbrains.kotlin.incremental.normalCacheVersion import java.io.File @@ -32,8 +31,6 @@ class CacheVersionProvider(private val paths: BuildDataPaths) { fun normalVersion(target: ModuleBuildTarget): CacheVersion = normalCacheVersion(target.dataRoot) - fun experimentalVersion(target: ModuleBuildTarget): CacheVersion = experimentalCacheVersion(target.dataRoot) - fun dataContainerVersion(): CacheVersion = dataContainerCacheVersion(KotlinDataContainerTarget.dataRoot) fun allVersions(targets: Iterable): Iterable { @@ -42,7 +39,6 @@ class CacheVersionProvider(private val paths: BuildDataPaths) { for (dataRoot in targets.map { it.dataRoot }) { versions.add(normalCacheVersion(dataRoot)) - versions.add(experimentalCacheVersion(dataRoot)) } return versions diff --git a/jps-plugin/testData/incremental/changeIncrementalOption/incrementalOff/build.log b/jps-plugin/testData/incremental/changeIncrementalOption/incrementalOff/build.log index f6e4ae9a7bb..141a6fc4b0e 100644 --- a/jps-plugin/testData/incremental/changeIncrementalOption/incrementalOff/build.log +++ b/jps-plugin/testData/incremental/changeIncrementalOption/incrementalOff/build.log @@ -1,7 +1,7 @@ ================ Step #1 ================= 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 ------------------------------------------ Building module2 diff --git a/jps-plugin/testData/incremental/changeIncrementalOption/incrementalOffOn/build.log b/jps-plugin/testData/incremental/changeIncrementalOption/incrementalOffOn/build.log index 306a8e2c679..fb1064db698 100644 --- a/jps-plugin/testData/incremental/changeIncrementalOption/incrementalOffOn/build.log +++ b/jps-plugin/testData/incremental/changeIncrementalOption/incrementalOffOn/build.log @@ -1,7 +1,7 @@ ================ Step #1 ================= 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 ------------------------------------------ Building module2 diff --git a/jps-plugin/testData/incremental/changeIncrementalOption/incrementalOffOn/expected-kotlin-caches.txt b/jps-plugin/testData/incremental/changeIncrementalOption/incrementalOffOn/expected-kotlin-caches.txt index 215d8ffbdbd..afaffa21b44 100644 --- a/jps-plugin/testData/incremental/changeIncrementalOption/incrementalOffOn/expected-kotlin-caches.txt +++ b/jps-plugin/testData/incremental/changeIncrementalOption/incrementalOffOn/expected-kotlin-caches.txt @@ -5,7 +5,6 @@ kotlin-data-container id-to-file.tab lookups.tab Module 'module1' production - experimental-format-version.txt format-version.txt jvm-build-meta-info.txt class-fq-name-to-source.tab @@ -14,7 +13,6 @@ Module 'module1' production source-to-classes.tab Module 'module1' tests Module 'module2' production - experimental-format-version.txt format-version.txt jvm-build-meta-info.txt inline-functions.tab @@ -24,7 +22,6 @@ Module 'module2' production source-to-classes.tab Module 'module2' tests Module 'module3' production - experimental-format-version.txt format-version.txt jvm-build-meta-info.txt class-fq-name-to-source.tab @@ -33,7 +30,6 @@ Module 'module3' production source-to-classes.tab Module 'module3' tests Module 'module4' production - experimental-format-version.txt format-version.txt jvm-build-meta-info.txt class-fq-name-to-source.tab diff --git a/jps-plugin/testData/incremental/lazyKotlinCaches/class/expected-kotlin-caches.txt b/jps-plugin/testData/incremental/lazyKotlinCaches/class/expected-kotlin-caches.txt index a8e59355f1c..f49b588520e 100644 --- a/jps-plugin/testData/incremental/lazyKotlinCaches/class/expected-kotlin-caches.txt +++ b/jps-plugin/testData/incremental/lazyKotlinCaches/class/expected-kotlin-caches.txt @@ -5,7 +5,6 @@ kotlin-data-container id-to-file.tab lookups.tab Module 'module' production - experimental-format-version.txt format-version.txt jvm-build-meta-info.txt class-fq-name-to-source.tab diff --git a/jps-plugin/testData/incremental/lazyKotlinCaches/classInheritance/expected-kotlin-caches.txt b/jps-plugin/testData/incremental/lazyKotlinCaches/classInheritance/expected-kotlin-caches.txt index 15f2ab8c248..b4e54efb164 100644 --- a/jps-plugin/testData/incremental/lazyKotlinCaches/classInheritance/expected-kotlin-caches.txt +++ b/jps-plugin/testData/incremental/lazyKotlinCaches/classInheritance/expected-kotlin-caches.txt @@ -5,7 +5,6 @@ kotlin-data-container id-to-file.tab lookups.tab Module 'module' production - experimental-format-version.txt format-version.txt jvm-build-meta-info.txt class-fq-name-to-source.tab diff --git a/jps-plugin/testData/incremental/lazyKotlinCaches/constant/expected-kotlin-caches.txt b/jps-plugin/testData/incremental/lazyKotlinCaches/constant/expected-kotlin-caches.txt index 7011a7065d5..1232a083a32 100644 --- a/jps-plugin/testData/incremental/lazyKotlinCaches/constant/expected-kotlin-caches.txt +++ b/jps-plugin/testData/incremental/lazyKotlinCaches/constant/expected-kotlin-caches.txt @@ -5,7 +5,6 @@ kotlin-data-container id-to-file.tab lookups.tab Module 'module' production - experimental-format-version.txt format-version.txt jvm-build-meta-info.txt constants.tab diff --git a/jps-plugin/testData/incremental/lazyKotlinCaches/function/expected-kotlin-caches.txt b/jps-plugin/testData/incremental/lazyKotlinCaches/function/expected-kotlin-caches.txt index d44fd6c4253..ac0c703af90 100644 --- a/jps-plugin/testData/incremental/lazyKotlinCaches/function/expected-kotlin-caches.txt +++ b/jps-plugin/testData/incremental/lazyKotlinCaches/function/expected-kotlin-caches.txt @@ -5,7 +5,6 @@ kotlin-data-container id-to-file.tab lookups.tab Module 'module' production - experimental-format-version.txt format-version.txt jvm-build-meta-info.txt internal-name-to-source.tab diff --git a/jps-plugin/testData/incremental/lazyKotlinCaches/inlineFunctionWithUsage/expected-kotlin-caches.txt b/jps-plugin/testData/incremental/lazyKotlinCaches/inlineFunctionWithUsage/expected-kotlin-caches.txt index cc6f16e3ad5..97b4eb9d00e 100644 --- a/jps-plugin/testData/incremental/lazyKotlinCaches/inlineFunctionWithUsage/expected-kotlin-caches.txt +++ b/jps-plugin/testData/incremental/lazyKotlinCaches/inlineFunctionWithUsage/expected-kotlin-caches.txt @@ -5,7 +5,6 @@ kotlin-data-container id-to-file.tab lookups.tab Module 'module' production - experimental-format-version.txt format-version.txt jvm-build-meta-info.txt inline-functions.tab diff --git a/jps-plugin/testData/incremental/lazyKotlinCaches/inlineFunctionWithoutUsage/expected-kotlin-caches.txt b/jps-plugin/testData/incremental/lazyKotlinCaches/inlineFunctionWithoutUsage/expected-kotlin-caches.txt index cc6f16e3ad5..97b4eb9d00e 100644 --- a/jps-plugin/testData/incremental/lazyKotlinCaches/inlineFunctionWithoutUsage/expected-kotlin-caches.txt +++ b/jps-plugin/testData/incremental/lazyKotlinCaches/inlineFunctionWithoutUsage/expected-kotlin-caches.txt @@ -5,7 +5,6 @@ kotlin-data-container id-to-file.tab lookups.tab Module 'module' production - experimental-format-version.txt format-version.txt jvm-build-meta-info.txt inline-functions.tab diff --git a/jps-plugin/testData/incremental/lazyKotlinCaches/topLevelPropertyAccess/expected-kotlin-caches.txt b/jps-plugin/testData/incremental/lazyKotlinCaches/topLevelPropertyAccess/expected-kotlin-caches.txt index d44fd6c4253..ac0c703af90 100644 --- a/jps-plugin/testData/incremental/lazyKotlinCaches/topLevelPropertyAccess/expected-kotlin-caches.txt +++ b/jps-plugin/testData/incremental/lazyKotlinCaches/topLevelPropertyAccess/expected-kotlin-caches.txt @@ -5,7 +5,6 @@ kotlin-data-container id-to-file.tab lookups.tab Module 'module' production - experimental-format-version.txt format-version.txt jvm-build-meta-info.txt internal-name-to-source.tab diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/tasks/Tasks.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/tasks/Tasks.kt index dc71141d64f..e23c721faab 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/tasks/Tasks.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/tasks/Tasks.kt @@ -210,7 +210,6 @@ open class KotlinCompile : AbstractKotlinCompile(), Kotl get() = File(File(project.buildDir, KOTLIN_BUILD_DIR_NAME), name).apply { mkdirs() } private val cacheVersions by lazy { listOf(normalCacheVersion(taskBuildDirectory), - experimentalCacheVersion(taskBuildDirectory), dataContainerCacheVersion(taskBuildDirectory), gradleCacheVersion(taskBuildDirectory)) }