From b3b0f23a507515d7997dbbc39cea853fcf5fbaa0 Mon Sep 17 00:00:00 2001 From: Anton Lakotka Date: Thu, 18 May 2023 12:43:00 +0200 Subject: [PATCH] [Gradle] Deprecate rare api in KotlinDependencyHandler Recommend users default `project.dependencies` instead. Gradle's DependencyHanlder has its own evolution thus we cannot easily maintain API of KotlinDependencyHandler to look like Gradle's DependencyHandler. We're going to support only our own factory methods to create dependencies + `project` dependencies. KT-58759 Verification Pending --- .../gradle/plugin/HasKotlinDependencies.kt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libraries/tools/kotlin-gradle-plugin-api/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/HasKotlinDependencies.kt b/libraries/tools/kotlin-gradle-plugin-api/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/HasKotlinDependencies.kt index 818f16f271b..e595f29b048 100644 --- a/libraries/tools/kotlin-gradle-plugin-api/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/HasKotlinDependencies.kt +++ b/libraries/tools/kotlin-gradle-plugin-api/src/common/kotlin/org/jetbrains/kotlin/gradle/plugin/HasKotlinDependencies.kt @@ -59,15 +59,31 @@ interface KotlinDependencyHandler { fun project(notation: Map): ProjectDependency + @Deprecated( + "Scheduled for removal in Kotlin 2.0. Check KT-58759", + replaceWith = ReplaceWith("project.dependencies.enforcedPlatform(notation)") + ) fun enforcedPlatform(notation: Any): Dependency = project.dependencies.enforcedPlatform(notation) + @Deprecated( + "Scheduled for removal in Kotlin 2.0. Check KT-58759", + replaceWith = ReplaceWith("project.dependencies.enforcedPlatform(notation, configureAction)") + ) fun enforcedPlatform(notation: Any, configureAction: Action): Dependency = project.dependencies.enforcedPlatform(notation, configureAction) + @Deprecated( + "Scheduled for removal in Kotlin 2.0. Check KT-58759", + replaceWith = ReplaceWith("project.dependencies.platform(notation)") + ) fun platform(notation: Any): Dependency = project.dependencies.platform(notation) + @Deprecated( + "Scheduled for removal in Kotlin 2.0. Check KT-58759", + replaceWith = ReplaceWith("project.dependencies.platform(notation, configureAction)") + ) fun platform(notation: Any, configureAction: Action): Dependency = project.dependencies.platform(notation, configureAction)