-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support compiling common KMP code #377
Comments
This test runs fine for me: @Test
fun `foos`() {
val result = defaultCompilerConfig().apply {
sources = listOf(SourceFile.kotlin("kSource.kt", """
import kotlin.js.ExperimentalJsExport
@ExperimentalJsExport
fun add(a: Double, b: Double): Double {
return a + b
}
""".trimIndent()))
}.compile()
assertThat(result.exitCode).isEqualTo(ExitCode.OK)
} where is your |
It is in @Test
fun `foos`() {
val result = KotlinCompilation().apply {
sources = listOf(
SourceFile.kotlin(
"kSource.kt",
"""
import kotlin.js.JsExport
@JsExport
fun add(a: Double, b: Double): Double {
return a + b
}
""".trimIndent()
)
)
}.compile()
assertEquals(KotlinCompilation.ExitCode.OK, result.exitCode)
} Yields:
|
|
I see, there is a new experimental option |
I would like to be able to compile code as
common module sources
so that I can test compilation of@JsExport
annotated classes. I tried messing with the paths of the modules, but could not find a way to convince the compiler that my code is in the common module.As an example, you can try compiling something simple like:
You will get a compiler error along the lines of:
The text was updated successfully, but these errors were encountered: