Skip to content

Commit

Permalink
remove jsNativeCommon sourceSet from MultiplatformConventions plugi…
Browse files Browse the repository at this point in the history
…n and specify it only in runtime module.
  • Loading branch information
IlyaGulya committed Mar 20, 2024
1 parent ffb4d17 commit 672ff65
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Project> {
Expand All @@ -21,7 +22,7 @@ class MultiplatformConventions : Plugin<Project> {

jvm()

js {
val jsConfigure: KotlinJsTargetDsl.() -> Unit = {
browser {
testTask {
it.useKarma {
Expand All @@ -35,30 +36,13 @@ class MultiplatformConventions : Plugin<Project> {
}
}
}
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()
Expand Down
10 changes: 10 additions & 0 deletions runtime/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ apiValidation {
}

kotlin {
applyDefaultHierarchyTemplate {
it.common {
it.group("jsNativeCommon") {
it.withJs()
it.withWasmJs()
it.withNative()
}
}
}

sourceSets {
commonTest {
dependencies {
Expand Down

0 comments on commit 672ff65

Please sign in to comment.