summaryrefslogtreecommitdiff
path: root/plugins/kotlin/jps/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/CacheAttributesManager.kt
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/kotlin/jps/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/CacheAttributesManager.kt')
-rw-r--r--plugins/kotlin/jps/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/CacheAttributesManager.kt44
1 files changed, 0 insertions, 44 deletions
diff --git a/plugins/kotlin/jps/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/CacheAttributesManager.kt b/plugins/kotlin/jps/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/CacheAttributesManager.kt
deleted file mode 100644
index 88389169cee6..000000000000
--- a/plugins/kotlin/jps/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/CacheAttributesManager.kt
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
-
-package org.jetbrains.kotlin.jps.incremental
-
-/**
- * Manages cache attributes values.
- *
- * Attribute values can be loaded by calling [loadActual].
- * Based on loaded actual and fixed [expected] values [CacheAttributesDiff] can be constructed which can calculate [CacheStatus].
- * Build system may perform required actions based on that (i.e. rebuild something, clearing caches, etc...).
- *
- * [CacheAttributesDiff] can be used to cache current attribute values and then can be used as facade for cache version operations.
- */
-interface CacheAttributesManager<Attrs : Any> {
- /**
- * Cache attribute values expected by the current version of build system and compiler.
- * `null` means that cache is not required (incremental compilation is disabled).
- */
- val expected: Attrs?
-
- /**
- * Load actual cache attribute values.
- * `null` means that cache is not yet created.
- *
- * This is internal operation that should be implemented by particular implementation of CacheAttributesManager.
- * Consider using `loadDiff().actual` for getting actual values.
- */
- fun loadActual(): Attrs?
-
- /**
- * Write [values] as cache attributes for next build execution.
- */
- fun writeVersion(values: Attrs? = expected)
-
- /**
- * Check if cache with [actual] attributes values can be used when [expected] attributes are required.
- */
- fun isCompatible(actual: Attrs, expected: Attrs): Boolean = actual == expected
-}
-
-fun <Attrs : Any> CacheAttributesManager<Attrs>.loadDiff(
- actual: Attrs? = this.loadActual(),
- expected: Attrs? = this.expected
-) = CacheAttributesDiff(this, actual, expected) \ No newline at end of file