[Gradle] Declare kotlin.caching.enabled system property read

#KT-49107 Fixed
This commit is contained in:
Alexander Likhachev
2021-10-14 14:48:35 +03:00
committed by Space
parent f9d4e0639c
commit 1160e3875a
@@ -17,9 +17,9 @@
package org.jetbrains.kotlin.gradle.tasks
import org.gradle.api.Task
import org.jetbrains.kotlin.gradle.utils.getSystemProperty
internal fun isBuildCacheEnabledForKotlin(): Boolean =
System.getProperty(KOTLIN_CACHING_ENABLED_PROPERTY)?.toBoolean() ?: true
private fun Task.isBuildCacheEnabledForKotlin(): Boolean = project.getSystemProperty(KOTLIN_CACHING_ENABLED_PROPERTY)?.toBoolean() ?: true
internal fun <T : Task> T.cacheOnlyIfEnabledForKotlin() {
outputs.cacheIf { isBuildCacheEnabledForKotlin() }