Browse Source

Update gradle plugin to make sure that skiko.wasm is unpacked for web tests too (#4030)

Co-authored-by: Oleksandr.Karpovich <oleksandr.karpovich@jetbrains.com>
pull/4031/head v1.6.0-dev1334
Oleksandr Karpovich 1 year ago committed by GitHub
parent
commit
972c740c1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/experimental/web/internal/configureExperimentalWebApplication.kt

5
gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/experimental/web/internal/configureExperimentalWebApplication.kt

@ -31,9 +31,11 @@ internal fun Collection<KotlinJsIrTarget>.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<ExperimentalUnpackSkikoWasmRuntimeTask>(taskName) {
skikoRuntimeFiles = skikoJsWasmRuntimeConfiguration
@ -42,6 +44,9 @@ internal fun Collection<KotlinJsIrTarget>.configureExperimentalWebApplication(
project.tasks.named(mainCompilation.processResourcesTaskName).configure { processResourcesTask ->
processResourcesTask.dependsOn(unpackRuntime)
}
project.tasks.named(testCompilation.processResourcesTaskName).configure { processResourcesTask ->
processResourcesTask.dependsOn(unpackRuntime)
}
}
}

Loading…
Cancel
Save