[Gradle] Deprecate the system property for compiler execution strategy
#KT-51830 Fixed
This commit is contained in:
committed by
Space
parent
f5e89079e9
commit
96b71e83ec
+10
-3
@@ -439,10 +439,17 @@ internal class PropertiesProvider private constructor(private val project: Proje
|
|||||||
|
|
||||||
val kotlinCompilerExecutionStrategy: KotlinCompilerExecutionStrategy
|
val kotlinCompilerExecutionStrategy: KotlinCompilerExecutionStrategy
|
||||||
get() {
|
get() {
|
||||||
val gradleProperty = property("kotlin.compiler.execution.strategy")
|
val propertyName = "kotlin.compiler.execution.strategy"
|
||||||
|
val gradleProperty = property(propertyName)
|
||||||
// system property is for backward compatibility
|
// system property is for backward compatibility
|
||||||
val value = (gradleProperty ?: System.getProperty("kotlin.compiler.execution.strategy"))?.toLowerCase()
|
val value = (gradleProperty ?: System.getProperty(propertyName)?.also {
|
||||||
return KotlinCompilerExecutionStrategy.fromProperty(value)
|
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? {
|
private fun propertyWithDeprecatedVariant(propName: String, deprecatedPropName: String): String? {
|
||||||
|
|||||||
Reference in New Issue
Block a user