[MPP] Don't report HMPP deprecation warnings on subprojects

MPP plugin applied to a root project leads to false positive reports
in its subprojects. Also, granular metadata flag is not supposed to be
set in subprojects. Reporting only for the root project should cover
most of the cases.

KT-55891
This commit is contained in:
Pavel Kirpichenkov
2023-01-24 15:12:02 +02:00
committed by Space Team
parent 7c3cc1d5c1
commit 37c87b0a84
3 changed files with 10 additions and 0 deletions
@@ -0,0 +1,7 @@
plugins {
kotlin("multiplatform")
}
kotlin {
jvm()
}
@@ -38,6 +38,8 @@ internal fun checkAndReportDeprecatedNativeTargets(project: Project) {
* Warnings have to be reported only for successfully evaluated projects without errors.
*/
internal fun checkAndReportDeprecatedMppProperties(project: Project) {
if (project !== project.rootProject) return
val projectProperties = project.kotlinPropertiesProvider
if (projectProperties.ignoreHmppDeprecationWarnings == true) return