[mpp] Test that every deprecated pre-HMPP property triggers an Error

Previously all these properties were put together, so only one
of them could have triggered the Error

#KT-59304 Verification Pending
This commit is contained in:
Stanislav Erokhin
2023-08-01 11:15:51 +02:00
committed by teamcity
parent fcd440fd9e
commit d99f8ac9b4
@@ -26,24 +26,22 @@ class MppDiagnosticsIt : KGPBaseTest() {
@GradleTest @GradleTest
fun testDeprecatedMppProperties(gradleVersion: GradleVersion) { fun testDeprecatedMppProperties(gradleVersion: GradleVersion) {
project("mppDeprecatedProperties", gradleVersion) { for (deprecatedProperty in this.deprecatedFlags) {
checkDeprecatedProperties(isDeprecationExpected = false) project("mppDeprecatedProperties", gradleVersion) {
checkDeprecatedProperties(isDeprecationExpected = false)
this.gradleProperties.appendText( this.gradleProperties.appendText(
defaultFlags.entries.joinToString( "${deprecatedProperty.key}=${deprecatedProperty.value}${System.lineSeparator()}"
prefix = System.lineSeparator(), )
postfix = System.lineSeparator(), checkDeprecatedProperties(isDeprecationExpected = true)
separator = System.lineSeparator(),
) { (prop, value) -> "$prop=$value" }
)
checkDeprecatedProperties(isDeprecationExpected = true)
// remove the MPP plugin from the top-level project and check the warnings are still reported in subproject // remove the MPP plugin from the top-level project and check the warnings are still reported in subproject
this.buildGradleKts.writeText("") this.buildGradleKts.writeText("")
checkDeprecatedProperties(isDeprecationExpected = true) checkDeprecatedProperties(isDeprecationExpected = true)
this.gradleProperties.appendText("kotlin.internal.suppressGradlePluginErrors=PreHMPPFlagsError${System.lineSeparator()}") this.gradleProperties.appendText("kotlin.internal.suppressGradlePluginErrors=PreHMPPFlagsError${System.lineSeparator()}")
checkDeprecatedProperties(isDeprecationExpected = false) checkDeprecatedProperties(isDeprecationExpected = false)
}
} }
} }
@@ -202,7 +200,7 @@ class MppDiagnosticsIt : KGPBaseTest() {
} }
} }
private val defaultFlags: Map<String, String> private val deprecatedFlags: Map<String, String>
get() = mapOf( get() = mapOf(
"kotlin.mpp.enableGranularSourceSetsMetadata" to "true", "kotlin.mpp.enableGranularSourceSetsMetadata" to "true",
"kotlin.mpp.enableCompatibilityMetadataVariant" to "false", "kotlin.mpp.enableCompatibilityMetadataVariant" to "false",