KPM: change detection of single-platform fragments to support WASM

The previous predicate checked only for JVM/Android and JS, now the
check is independent of the particular platform
This commit is contained in:
Sergey Igushkin
2022-02-01 00:42:45 +04:00
committed by Space
parent 43f7d0fe95
commit 29fe11b957
@@ -120,8 +120,8 @@ internal open class KotlinCommonFragmentMetadataCompilationDataImpl(
override val isActive: Boolean
get() = !fragment.isNativeShared() &&
fragment.containingModule.variantsContainingFragment(fragment).run {
!all { it.platformType in setOf(KotlinPlatformType.androidJvm, KotlinPlatformType.jvm)} &&
!all { it.platformType == KotlinPlatformType.js }
!all { it.platformType in setOf(KotlinPlatformType.androidJvm, KotlinPlatformType.jvm) } &&
mapTo(hashSetOf()) { it.platformType }.size > 1
}
override val kotlinOptions: KotlinMultiplatformCommonOptions = KotlinMultiplatformCommonOptionsImpl()