[gradle] Gradle property to switch between caching orchestration machineries

This is needed only for the translation period between old (Gradle) machinery
and the one (implemented directly in the K/N compiler)
This commit is contained in:
Igor Chevdar
2023-01-03 20:50:57 +02:00
committed by Space Team
parent 9aa287257b
commit 84d9afafd2
5 changed files with 53 additions and 6 deletions
@@ -236,6 +236,7 @@ class CachedLibraries(
fun computeVersionedCacheDirectory(baseCacheDirectory: File, library: KotlinLibrary, allLibraries: List<KotlinLibrary>): File {
val dependencies = getAllDependencies(library, allLibraries)
val messageDigest = MessageDigest.getInstance("SHA-256")
messageDigest.update(compilerMarker)
messageDigest.digestLibrary(library)
dependencies.sortedBy { it.uniqueName }.forEach { messageDigest.digestLibrary(it) }
@@ -252,5 +253,8 @@ class CachedLibraries(
const val INLINE_FUNCTION_BODIES_FILE_NAME = "inline_bodies"
const val CLASS_FIELDS_FILE_NAME = "class_fields"
const val EAGER_INITIALIZED_PROPERTIES_FILE_NAME = "eager_init"
// TODO: Remove after dropping Gradle cache orchestration.
private val compilerMarker = "K/N orchestration".encodeToByteArray()
}
}