I have very simple question regarding KMM. Can I e...
# multiplatform
d
I have very simple question regarding KMM. Can I export module (written completely in Kotlin) as an iOS library(same as *.aar in Android) from Windows PC and use it in iOS application project on macOS? Actual requirement: https://kotlinlang.slack.com/archives/C3PQML5NU/p1634050993470800?thread_ts=1634050480.468500&cid=C3PQML5NU
k
You can't build apple targets on non-apple machines. You need Xcode-related tools, and Apple doesn't let you do that from non-macs.
d
Ok let's assume that I'm using MAC
k
You could use CI to do the actual building. Like use Github Actions to build.
d
then can I do it?
k
Oh, then yes. You would build an Xcode framework and you can pull that into Xcode and use it. Completely from Kotlin
👍 2
d
In and individual iOS project having no KMM module?
t
Unsure what you mean exactly by the last question, but yes, you can generate an xcframework and your consumer will have no idea it is written in Kotlin
👍 1
There can be issues when consuming multiple distinct Kotlin frameworks, unsure if that has been resolved
d
ok
Please don't judge me how we are using reusing our code right now 😅 Requirement is to generate some kind of HTML string based on data and currently we are using code written in JS, loading it in WebView, then using WebView's JS bridge to obtain the generated HTML into Kotlin/ Swift. So I was thinking of using
kotlinx.html
library for some KMM module and use that module as a library for my both Android as well as iOS project
PS. If you are interested, later we convert that HTML into PDF
t
It doesn't look like
kotlinx.html
supports Kotlin Native
🙃 2