From 972c740c1e95aa1dd257e67cd957fbffb93835e5 Mon Sep 17 00:00:00 2001 From: Oleksandr Karpovich Date: Mon, 11 Dec 2023 18:25:57 +0300 Subject: [PATCH] Update gradle plugin to make sure that skiko.wasm is unpacked for web tests too (#4030) Co-authored-by: Oleksandr.Karpovich --- .../web/internal/configureExperimentalWebApplication.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/experimental/web/internal/configureExperimentalWebApplication.kt b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/experimental/web/internal/configureExperimentalWebApplication.kt index bf262212538..06c6b284fd3 100644 --- a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/experimental/web/internal/configureExperimentalWebApplication.kt +++ b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/experimental/web/internal/configureExperimentalWebApplication.kt @@ -31,9 +31,11 @@ internal fun Collection.configureExperimentalWebApplication( } forEach { val mainCompilation = it.compilations.getByName("main") + val testCompilation = it.compilations.getByName("test") val unpackedRuntimeDir = project.layout.buildDirectory.dir("compose/skiko-wasm/${it.targetName}") val taskName = "unpackSkikoWasmRuntime${it.targetName.uppercaseFirstChar()}" mainCompilation.defaultSourceSet.resources.srcDir(unpackedRuntimeDir) + testCompilation.defaultSourceSet.resources.srcDir(unpackedRuntimeDir) val unpackRuntime = project.registerTask(taskName) { skikoRuntimeFiles = skikoJsWasmRuntimeConfiguration @@ -42,6 +44,9 @@ internal fun Collection.configureExperimentalWebApplication( project.tasks.named(mainCompilation.processResourcesTaskName).configure { processResourcesTask -> processResourcesTask.dependsOn(unpackRuntime) } + project.tasks.named(testCompilation.processResourcesTaskName).configure { processResourcesTask -> + processResourcesTask.dependsOn(unpackRuntime) + } } }