Refactoring: extract checking caches versions to function
This commit is contained in:
@@ -114,6 +114,13 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
|
|||||||
|
|
||||||
if (targets.none { hasKotlin[it] == true }) return
|
if (targets.none { hasKotlin[it] == true }) return
|
||||||
|
|
||||||
|
checkCachesVersions(context, chunk)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun checkCachesVersions(context: CompileContext, chunk: ModuleChunk) {
|
||||||
|
val targets = chunk.targets
|
||||||
|
val dataManager = context.projectDescriptor.dataManager
|
||||||
|
|
||||||
val cacheVersionsProvider = CacheVersionProvider(dataManager.dataPaths)
|
val cacheVersionsProvider = CacheVersionProvider(dataManager.dataPaths)
|
||||||
val allVersions = cacheVersionsProvider.allVersions(targets)
|
val allVersions = cacheVersionsProvider.allVersions(targets)
|
||||||
val actions = allVersions.map { it.checkVersion() }.toMutableSet()
|
val actions = allVersions.map { it.checkVersion() }.toMutableSet()
|
||||||
@@ -152,7 +159,6 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
|
|||||||
applyActionsOnCacheVersionChange(actions, cacheVersionsProvider, context, dataManager, targets, fsOperations)
|
applyActionsOnCacheVersionChange(actions, cacheVersionsProvider, context, dataManager, targets, fsOperations)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun chunkBuildFinished(context: CompileContext?, chunk: ModuleChunk?) {
|
override fun chunkBuildFinished(context: CompileContext?, chunk: ModuleChunk?) {
|
||||||
super.chunkBuildFinished(context, chunk)
|
super.chunkBuildFinished(context, chunk)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user