diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinProperties.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinProperties.kt index ae615745cb5..be44099f25f 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinProperties.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinProperties.kt @@ -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? {