From 49e197c67ac40e68f55f8e1d28a162c8a84507c0 Mon Sep 17 00:00:00 2001 From: Ilya Gulya Date: Wed, 20 Mar 2024 13:02:53 +0500 Subject: [PATCH] remove `jsNativeCommon` sourceSet from MultiplatformConventions plugin and specify it only in runtime module. --- .../multiplatform/MultiplatformConventions.kt | 24 ++++--------------- runtime/build.gradle | 10 ++++++++ 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/buildLogic/multiplatform-convention/src/main/kotlin/app/cash/sqldelight/multiplatform/MultiplatformConventions.kt b/buildLogic/multiplatform-convention/src/main/kotlin/app/cash/sqldelight/multiplatform/MultiplatformConventions.kt index 0e7af61bf29d..3df0428c0a72 100644 --- a/buildLogic/multiplatform-convention/src/main/kotlin/app/cash/sqldelight/multiplatform/MultiplatformConventions.kt +++ b/buildLogic/multiplatform-convention/src/main/kotlin/app/cash/sqldelight/multiplatform/MultiplatformConventions.kt @@ -6,6 +6,7 @@ import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension import org.jetbrains.kotlin.gradle.dsl.kotlinExtension import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl +import org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinJsTargetDsl import org.jetbrains.kotlin.konan.target.HostManager class MultiplatformConventions : Plugin { @@ -21,7 +22,7 @@ class MultiplatformConventions : Plugin { jvm() - js { + val jsConfigure: KotlinJsTargetDsl.() -> Unit = { browser { testTask { it.useKarma { @@ -35,30 +36,13 @@ class MultiplatformConventions : Plugin { } } } + js(jsConfigure) @OptIn(ExperimentalWasmDsl::class) - wasmJs { - browser { - testTask { - it.useKarma { - useChromeHeadless() - } - } - } - compilations.configureEach { - it.kotlinOptions { - moduleKind = "umd" - } - } - } + wasmJs(jsConfigure) @OptIn(ExperimentalKotlinGradlePluginApi::class) applyDefaultHierarchyTemplate { common { - group("jsNativeCommon") { - withJs() - withWasmJs() - withNative() - } group("jsCommon") { withJs() withWasmJs() diff --git a/runtime/build.gradle b/runtime/build.gradle index aa37ffd2b2ed..e6a243bf47d0 100644 --- a/runtime/build.gradle +++ b/runtime/build.gradle @@ -16,6 +16,16 @@ apiValidation { } kotlin { + applyDefaultHierarchyTemplate { + it.common { + it.group("jsNativeCommon") { + it.withJs() + it.withWasmJs() + it.withNative() + } + } + } + sourceSets { commonTest { dependencies {