diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/utils/singleAction.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/utils/singleAction.kt index fae71f323bf..b05662f413b 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/utils/singleAction.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/utils/singleAction.kt @@ -6,7 +6,6 @@ package org.jetbrains.kotlin.gradle.utils import org.gradle.api.Project -import org.gradle.api.logging.Logger import java.util.* /** @@ -50,40 +49,3 @@ internal object SingleActionPerBuild : SingleAction() { internal object SingleActionPerProject : SingleAction() { override fun selectKey(project: Project) = project } - -/** - * Object that allows to display warning once per build - * - * Warning: if KGP is loaded multiple times by different classloaders, warnings with the same id may be shown more than once - */ -internal object SingleWarningPerBuild { - private const val ACTION_ID_SHOW_WARNING = "show-warning:" - - /** - * Prints a warning with [warningText] using logger of [project] - * - * Warning: if KGP is loaded multiple times by different classloaders, warnings with the same id may be shown more than once - */ - fun show(project: Project, warningText: String) = show(project, project.logger, warningText) - - /** - * Prints a warning with [warningText] using [logger] - * - * Warning: if KGP is loaded multiple times by different classloaders, warnings with the same id may be shown more than once - */ - fun show(project: Project, logger: Logger, warningText: String) = - SingleActionPerBuild.run(project, ACTION_ID_SHOW_WARNING + warningText) { - logger.warn(warningText) - } - - /** - * Prints a deprecation warning for [target] of type [type] using logger of [project]. - * If there's a replacement for it, you could specify [replacement] - * - * Warning: if KGP is loaded multiple times by different classloaders, warnings with the same id may be shown more than once - */ - fun deprecation(project: Project, type: String, target: String, replacement: String? = null) { - val replacementMessage = replacement?.let { " Please, use '$replacement' instead." } ?: "" - show(project, "Warning: $type '$target' is deprecated and will be removed in next major releases.$replacementMessage\n") - } -}