https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
s

Sebastian Kaspari

01/19/2021, 12:16 PM
I wonder what the best setup is if you have an independent iOS app that should consume a multiplatform library from maven. Would you create some kind of small shell kmm setup locally to consume the maven dependency and build a local framework to consume from the iOS app? Or are there other, more iOS idiomatic ways of doing that (which do not require a full gradle build setup locally)?
💯 1
m

matej

01/19/2021, 2:31 PM
I guess you could publish the iOS framework to a private Cocoapods repo, couldn't you?
s

Sebastian Kaspari

01/19/2021, 3:16 PM
Hm, interesting. I need to look into that. Looks like there’s a
native.cocoapods
gradle plugin? 🤔
p

Paul Woitaschek

01/19/2021, 5:36 PM
You can just build the binaries and add Package.swift in your MPP library
s

Sebastian Kaspari

01/20/2021, 1:05 PM
@Paul Woitaschek Thanks! I just tried this gradle plugin for generating a swift package. This worked nicely in a test setup. I wonder how that would work if it gets more complicated, e.g. if the library would depend on ktor. Not sure if I’d still get around having a local kmm project for iOS? Or maybe I could build a swift package from that kmm project that binds everything together? 🤔
p

Paul Woitaschek

01/20/2021, 2:02 PM
@Sebastian Kaspari It's a binary framework, it has all the code bundled in
j

John O'Reilly

01/22/2021, 4:51 PM
Wrote a short post on using the above plugin https://johnoreilly.dev/posts/kotlinmultiplatform-swift-package/
s

Sebastian Kaspari

01/22/2021, 6:43 PM
@John O'Reilly Awesome. Will read that. 🙂