cashapp / zipline

Run Kotlin/JS libraries in Kotlin/JVM and Kotlin/Native programs
Apache License 2.0
2.04k stars 154 forks source link

Build issues / guidance how to use this for JVM #1046

Open ghost opened 1 year ago

ghost commented 1 year ago

Really cool project, after ready the blog I would really like to try this out for the regular JVM. I've spent quite some time to get it running but even after the latest release I'm still getting seemingly random errors. After battling a lot of other errors (mostly related to Android development setup that was missing) I'm now finally to this error which fails compilation:

The following declaration is incompatible because parameter types are different:
    internal actual fun [Error type: Unresolved type for Zipline].multiplatformLoadJsModule(bytecode: ByteArray, id: String): [Error type: Return type for function cannot be resolved]

Could you provide some guidance on how to resolve this?

In general it would be really helpful to understand better how this could be used in a regular JVM project, even with the Trivia example it's not entirely clear to me how this works. It might be lack of understanding KMM, I haven't used that much before. Maybe a standalone sample repo with examples might be helpful for this?

swankjesse commented 1 year ago

Agreed that we could add some more samples!

The redwood repo has an integration, though it’s extremely powerful and not necessarily suitable as a sample. https://github.com/cashapp/redwood

Another place to look is this test: https://github.com/cashapp/zipline/tree/trunk/zipline-gradle-plugin/src/test/projects/basic