So.. suppose I have a lib written using just kotli...
# multiplatform
j
So.. suppose I have a lib written using just kotlin (I think) classes... what should I do if I want to make it available for JS? I plan to release it as a maven artifact and found some docs of how to do it... is there any problem if the kotlin/java plugins are applied together with the js plugins?
g
You should apply kotlin jvm plugin to one module and kotlin js plugin to another gradle module. It how multiplatform projects work in Kotlin
and move your common code to common module
j
So even if all my code is jvm and js compatible I should split it with a common module... I will give it a try...
g
not split, just convert your code from jvm to common and create an empty modules for jvm and js
it allows to compile common code to platfrom specific one
Take a look on this my project https://github.com/gildor/knel
I have pure Kotlin implementaion in common and empty projects for each platform
c
nice, a NonEmptyList this should bei in the stdlib
g
actually I just didn’t update Readme yet, but be free to copy-paste implementation to your project, if you want to try. It’s tested now and works properly