[JS, IR] Fix wasm tests
This commit is contained in:
+2
-4
@@ -42,10 +42,8 @@ constructor(
|
||||
private fun configureBinaryen(binary: JsIrBinary, binaryenDsl: BinaryenExec.() -> Unit) {
|
||||
val linkTask = binary.linkTask
|
||||
|
||||
val compiledMjsFile = linkTask.flatMap { it.outputFileProperty }
|
||||
|
||||
val compiledWasmFile = compiledMjsFile.map {
|
||||
it.parentFile.resolve("${it.nameWithoutExtension}.wasm")
|
||||
val compiledWasmFile = linkTask.map { link ->
|
||||
link.destinationDirectory.asFile.get().resolve(link.outputName.get() + ".wasm")
|
||||
}
|
||||
|
||||
//TODO This is temporary solution that overrides compiled files that triggers recompile and reoptimize wasm every time (when binaryen is enabled)
|
||||
|
||||
+2
-1
@@ -60,7 +60,8 @@ abstract class KotlinJsIrLink @Inject constructor(
|
||||
@get:Internal
|
||||
internal lateinit var compilation: KotlinCompilationData<*>
|
||||
|
||||
private val platformType by project.provider {
|
||||
@get:Internal
|
||||
val platformType by project.provider {
|
||||
compilation.platformType
|
||||
}
|
||||
|
||||
|
||||
+13
-1
@@ -124,8 +124,20 @@ abstract class KotlinJsIrSubTarget(
|
||||
testJs.inputFileProperty.set(
|
||||
project.layout.file(
|
||||
binary.linkSyncTask.map {
|
||||
val linkTask = binary.linkTask.get()
|
||||
val extension = when (linkTask.platformType) {
|
||||
KotlinPlatformType.wasm -> {
|
||||
".mjs"
|
||||
}
|
||||
|
||||
KotlinPlatformType.js -> {
|
||||
".js"
|
||||
}
|
||||
|
||||
else -> error("Only JS and WASM supported for KotlinJsTest")
|
||||
}
|
||||
it.destinationDir
|
||||
.resolve(binary.linkTask.get().outputName.get() + ".js")
|
||||
.resolve(linkTask.outputName.get() + extension)
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user