all i want to do is use a kotlin multiplatform lib...
# multiplatform
s
all i want to do is use a kotlin multiplatform lib on an xcode project. in the tutorial here https://kotlinlang.org/docs/tutorials/multiplatform-library.html they mention “Now check it with the command ./gradlew publishToMavenLocal and you should see a successful build. That’s it, our library is now successfully published and any Kotlin project can depend on it, whether it is another common library, JVM, JS, or Native application.” Can you use a maven dependency on an xcode project? Sorry for noob questions 🙂
r
You consume the maven dependency from kotlin native. Then you can produce a framework from that via gradle and import that framework into your xcode project.
s
i see. are there any examples of this?
k
I was using this to generate an apple framework: https://kotlinlang.org/docs/tutorials/native/apple-framework.html
kotlinc-native lib.kt -produce framework -target ios_x64 -output iOS_sim/Demo
Or if you follow this: https://kotlinlang.org/docs/tutorials/native/mpp-ios-android.html the shared code project will generate an xcode framework in the builds folder
j
or if you just want to use your library without actually publishing it, you can use something like this:
pod 'myLib', :path => '../../my_lib/'
v
@Steven We recently published a Kotlin MPP standard project which publishes the iOS library to Cocoapods. https://github.com/novemberfiveco/kotlin-mpp-standard#publishing-your-ios-library-to-cocoapods
s
thank you very much everyone for your help! I can’t wait to try your suggestions. Will update here when i get it working! 😄

https://media.giphy.com/media/9K2nFglCAQClO/200.gif

🎉 1
thank you all very much for your help!