[MPP] Fix warning reports for subprojects

Properly report warnings for projects that don't apply multiplatform
plugin in the root project, but declare the obsolete properties

KT-55891
This commit is contained in:
Pavel Kirpichenkov
2023-01-26 20:48:37 +02:00
committed by Space Team
parent b0c360b1b6
commit a03db78ed2
2 changed files with 13 additions and 2 deletions
@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.gradle.mpp
import org.gradle.util.GradleVersion
import org.jetbrains.kotlin.gradle.testbase.*
import kotlin.io.path.appendText
import kotlin.io.path.writeText
import kotlin.test.assertFalse
import kotlin.test.assertTrue
@@ -27,6 +28,10 @@ class MppDeprecatedPropertiesIt : KGPBaseTest() {
)
checkDeprecations(isDeprecationExpected = true)
// remove the MPP plugin from the top-level project and check the warnings are still reported in subproject
this.buildGradleKts.writeText("")
checkDeprecations(isDeprecationExpected = true)
this.gradleProperties.appendText("kotlin.mpp.deprecatedProperties.nowarn=true${System.lineSeparator()}")
checkDeprecations(isDeprecationExpected = false)
}