diff --git a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/ComposePlugin.kt b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/ComposePlugin.kt index a831a9e8a7..0bc635f99a 100644 --- a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/ComposePlugin.kt +++ b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/ComposePlugin.kt @@ -24,11 +24,14 @@ import org.jetbrains.compose.experimental.internal.configureExperimental import org.jetbrains.compose.experimental.uikit.internal.resources.configureSyncTask import org.jetbrains.compose.internal.KOTLIN_MPP_PLUGIN_ID import org.jetbrains.compose.internal.mppExt +import org.jetbrains.compose.internal.mppExtOrNull import org.jetbrains.compose.internal.utils.currentTarget import org.jetbrains.compose.web.WebExtension import org.jetbrains.kotlin.gradle.plugin.KotlinDependencyHandler import org.jetbrains.kotlin.gradle.plugin.getKotlinPluginVersion import org.jetbrains.kotlin.gradle.dsl.KotlinCompile +import org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile +import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType internal val composeVersion get() = ComposeBuildConfig.composeVersion @@ -67,6 +70,23 @@ class ComposePlugin : Plugin { } } } + + disableSignatureClashCheck(project) + } + } + + private fun disableSignatureClashCheck(project: Project) { + val hasAnyWebTarget = project.mppExtOrNull?.targets?.firstOrNull { + it.platformType == KotlinPlatformType.js || + it.platformType == KotlinPlatformType.wasm + } != null + if (hasAnyWebTarget) { + // currently k/wasm compile task is covered by KotlinJsCompile type + project.tasks.withType(KotlinJsCompile::class.java).configureEach { + it.kotlinOptions.freeCompilerArgs += listOf( + "-Xklib-enable-signature-clash-checks=false", + ) + } } }