Is it currently possible to depend on 3rd party li...
# kotlin-native
k
Is it currently possible to depend on 3rd party libraries in a Kotlin Multi-platform library project? e.g. I want to write an auth library that wraps Auth0.swift and Auth0.Android that produces a iOS framework and android jar
j
yes. It should be possible. You have common code with API and than you depend from Android in android part and from Swift from Kotlin/Native part (via cinterop)
k
How do I tell gradle about the native Swift lib so I can import it in my Kotlin code
you build your swift code into Framework. Thank you may use
cinterop
from K/N to import it into K/N
k
Looks like only Obj-C frameworks work with Kotlin https://kotlinlang.org/docs/reference/native/objc_interop.html
"A Swift library can be used in Kotlin code if its API is exported to Objective-C with @objc. Pure Swift modules are not yet supported."
j
yes. it works via obj-c leyer and framework
k
The library I want to use is a pure Swift framework 😞
j
😞
if you have a small API set - you may add a tiny wrapper in Swift to have only needed APIs from the library exported to obj-c
k
Will Kotlin Native get support for pure Swift frameworks once swift gets module stability? https://forums.swift.org/t/plan-for-module-stability/14551
y
I’m interested in, too.