[Gradle] Lower deprecation level of KotlinCompilation source method

It makes IDE Import failing when method is used.
So tooling diagnostic with ERROR level is preferred in such cases.

^KT-58234 Verification Pending
This commit is contained in:
Anton Lakotka
2023-07-19 10:16:32 +02:00
committed by Space Team
parent c3b09e148b
commit f05856f6a0
4 changed files with 4 additions and 4 deletions
@@ -131,7 +131,7 @@ interface KotlinCompilation<out T : KotlinCommonOptionsDeprecated> : Named,
* Further details:
* https://kotl.in/compilation-source-deprecation
*/
@Deprecated("scheduled for removal with Kotlin 2.0", level = DeprecationLevel.ERROR)
@Deprecated("scheduled for removal with Kotlin 2.0")
fun source(sourceSet: KotlinSourceSet)
fun associateWith(other: KotlinCompilation<*>)
@@ -91,7 +91,7 @@ internal class KotlinCompilationImpl constructor(
override val kotlinSourceSets: ObservableSet<KotlinSourceSet>
get() = sourceSets.kotlinSourceSets
@Deprecated("scheduled for removal with Kotlin 2.0", level = DeprecationLevel.ERROR)
@Deprecated("scheduled for removal with Kotlin 2.0")
override fun source(sourceSet: KotlinSourceSet) {
project.kotlinToolingDiagnosticsCollector.report(project, KotlinCompilationSourceDeprecation(Throwable()))
sourceSets.source(sourceSet)
@@ -217,7 +217,7 @@ class SourceSetCommonizerTargetTest {
val nativeMain = kotlin.sourceSets.create("nativeMain")
listOf(linux1, linux2).forEach { target ->
@Suppress("DEPRECATION_ERROR")
@Suppress("DEPRECATION")
target.compilations.getByName("main").source(nativeMain)
}
@@ -112,7 +112,7 @@ class MppDiagnosticsFunctionalTest {
checkDiagnosticsWithMppProject("kotlinCompilationSourceDeprecation") {
kotlin {
val customMain = sourceSets.create("customMain")
@Suppress("DEPRECATION_ERROR")
@Suppress("DEPRECATION")
jvm().compilations.create("custom").source(customMain)
}
}