Publishing KMP SDKs with KMMBridge and SKIE

· 2 min read

Author: Kevin Galligan
The Kotlin Multiplatform tooling is designed around all developers building Kotlin locally. For many teams, this isn't the desired approach. KMMBridge allows you to publish iOS binary builds for your team. This series or posts will cover updates to KMMBridge, API design with SKIE, and other assorted topics to get you started with KMP in a native mobile team.

KMMBridge

Last year we published KMMBridge. In summary, the Kotlin Multiplatform tooling assumes developers will be locally editing and building Kotlin code. This makes sense in some cases, but over the years working with many teams, we’ve learned that most existing teams need other options.

Most successful KMP deployments involve writing CI builds that package and publish the Xcode Framework built from Kotlin to a remote location that Xcode can find and integrate. While this is not complex in principle, there are a lot of things to set up before a team can even start evaluating KMP. Worse, KMP is usually being pitched by Android engineers, who, generally speaking, are less familiar with production Xcode configuration.

Integrating KMP into and existing team already involves significant work. On top of that, most teams need to build a bunch of basic infrastructure with unfamiliar tools. The goal of KMMBridge was to at least make that first part easier.

We’ve had a lot of feedback over the past year, and we’ll be discussing some changes to our sample to support cases that KMMBridge did not in its default config.

SKIE

The interface produced by Kotlin for Swift, out of the box, is lacking some features that many teams really want. We’ve found teams that manually write wrappers around the Kotlin, a handful who have started generating their own wrappers, and a selection of various open source tools attempting to address this problem.

With a handful of notable exceptions, the available tools to address this problem aren’t great.

SKIE, Swift Kotlin Interface Enhancer, is a tool over a year in development. It significantly improves the API exported to Swift. SKIE uses various techniques to do this, including generating actual Swift code, then compiling and linking it back into the Xcode framework produced by the Kotlin compiler.

This is critical tooling for any team calling Kotlin from Swift. We will cover the basics of using SKIE in an SDK publishing scenario, and specifically some SDK design techniques to keep in mind.

SDK Design

We have built several client SDK projects, and have learned some lessons that will be valuable for SDK publishing in general, and using Kotlin with Swift in particular. This series will cover some of the most important points.