Fail only when KotlinPm20ProjectExtension is passed

to buildKotlinProjectStructureMetadata
#Fixes KTIJ-11586
This commit is contained in:
Anton Lakotka
2021-05-05 12:09:19 +02:00
committed by TeamCityServer
parent 291cd842b9
commit f94ed1a00c
@@ -131,7 +131,7 @@ data class KotlinProjectStructureMetadata(
internal fun buildKotlinProjectStructureMetadata(project: Project): KotlinProjectStructureMetadata? {
val topLevelExtensionOrNull = project.topLevelExtensionOrNull
require(topLevelExtensionOrNull is KotlinMultiplatformExtension) { "this function only works with the stable plugin" }
require(topLevelExtensionOrNull !is KotlinPm20ProjectExtension) { "this function only works with the stable plugin" }
val sourceSetsWithMetadataCompilations =
project.multiplatformExtensionOrNull?.targets?.getByName(KotlinMultiplatformPlugin.METADATA_TARGET_NAME)?.compilations?.associate {