[Gradle] Deprecate the system property for compiler execution strategy

#KT-51830 Fixed
This commit is contained in:
Alexander Likhachev
2022-04-04 18:03:16 +03:00
committed by Space
parent f5e89079e9
commit 96b71e83ec
@@ -439,10 +439,17 @@ internal class PropertiesProvider private constructor(private val project: Proje
val kotlinCompilerExecutionStrategy: KotlinCompilerExecutionStrategy
get() {
val gradleProperty = property("kotlin.compiler.execution.strategy")
val propertyName = "kotlin.compiler.execution.strategy"
val gradleProperty = property(propertyName)
// system property is for backward compatibility
val value = (gradleProperty ?: System.getProperty("kotlin.compiler.execution.strategy"))?.toLowerCase()
return KotlinCompilerExecutionStrategy.fromProperty(value)
val value = (gradleProperty ?: System.getProperty(propertyName)?.also {
SingleWarningPerBuild.show(
project,
"The '$propertyName' system property is deprecated and will have no effect since Kotlin 1.8.0. " +
"Please use the '$propertyName' project property or the `compilerExecutionStrategy` Kotlin compile task property instead."
)
})
return KotlinCompilerExecutionStrategy.fromProperty(value?.toLowerCase())
}
private fun propertyWithDeprecatedVariant(propName: String, deprecatedPropName: String): String? {