GarouDan
03/04/2019, 1:17 AMerror: compilation failed: Could not find "/Users/travis/build/my_project/application/native/wasm/build/klib/kotlinx.interop.wasm.dom-jsinterop.klib" in [/Users/travis/build/my_project, /Users/travis/.konan/klib, /Users/travis/.konan/kotlin-native-macos-1.1.2/klib/common, /Users/travis/.konan/kotlin-native-macos-1.1.2/klib/platform/wasm32].
But this error is only happening on the CI and not in my development machine.
The strange thing is the same error is also happening in appveyor and circleci too.
Does someone knows a workaround for this?svyatoslav.scherbina
03/04/2019, 7:26 AMapplication/native/wasm/build
on your development machine and CI?olonho
03/04/2019, 9:41 AMGarouDan
03/04/2019, 2:54 PM> Task :application:js:vanilla:jsProcessResources
> Task :application:js:vanilla:compileKotlinMetadata NO-SOURCE
> Task :application:js:vanilla:metadataMainClasses UP-TO-DATE
> Task :application:js:vanilla:metadataJar
> Task :application:js:vanilla:jsTestProcessResources NO-SOURCE
> Task :application:native:wasm:jsinterop UP-TO-DATE
> Task :common:compileKotlinNativeAndroidArm32
Downloading native dependencies (LLVM, sysroot etc). This is a one-time action performed only on the first run of the compiler.
> Task :application:native:wasm:compileKotlinWasm32 FAILED
* Source files: Example.kt
* Compiler version info: Konan: 1.1.2 / Kotlin: 1.3.21
* Output kind: LIBRARY
GarouDan
03/04/2019, 2:55 PMapplication/native/wasm
, so I don’t know how to remove this.
My build.gradle.kts is the following:
import org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile
import java.nio.file.Paths
plugins {
kotlin("multiplatform")
}
repositories {
jcenter()
}
val packageName = "kotlinx.interop.wasm.dom"
val jsinteropKlibFileName = Paths.get(buildDir.toString(), "klib", "$packageName-jsinterop.klib").toString()
kotlin {
wasm32 {
compilations["main"].outputKinds("EXECUTABLE")
compilations["main"].entryPoint("com.company.team.project.application.native_.wasm.main")
}
sourceSets {
val wasm32Main by getting {
kotlin.srcDir("src/main/kotlin")
resources.srcDir("src/main/resources")
dependencies {
implementation(files(jsinteropKlibFileName))
}
}
val wasm32Test by getting {
kotlin.srcDir("src/test/kotlin")
resources.srcDir("src/test/resources")
dependencies {
}
}
}
}
tasks {
withType<KotlinNativeCompile>().configureEach {
dependsOn("jsinterop")
}
}
task("jsinterop") {
val os = org.gradle.internal.os.OperatingSystem.current()!!
val workingDir = projectDir
val ext = if (os.isWindows) ".bat" else ""
val distributionPath = project.properties["konanHome"] as String
val jsinteropCommand = Paths.get(file(distributionPath).path, "bin", "jsinterop$ext").toString()
inputs.property("jsinteropCommand", jsinteropCommand)
inputs.property("jsinteropPackageName", packageName)
outputs.file(jsinteropKlibFileName)
exec {
commandLine(
jsinteropCommand,
"-pkg",
packageName,
"-o",
jsinteropKlibFileName,
"-target",
"wasm32"
)
}
}
GarouDan
03/04/2019, 2:56 PM