Skip to content

Swift Package Manager for Kotlin Multiplatform

Gradle Plugin Portal Version build&tests Coverage Quality Gate Status GitHub License

The Swift Package Manager for Kotlin Multiplatform Plugin, aka spmForKmp Gradle Plugin, is a tool designed to simplify integrating Swift Package Manager (SPM) dependencies into Kotlin Multiplatform (KMP) projects targeting Apple platform and calling the native API.

It allows you to (almost) effortlessly configure and use Swift packages in your Kotlin projects targeting Apple platforms, such as iOS.

Please Be Aware

Pure Swift packages can't be exported to Kotlin; creating a bridge with this plugin is a solution to bypass this issue.

Features

  • Create a Swift<->Kotlin bridge: Use your own Swift code for functionality that can't be done in Kotlin.
  • Use SPM third-Party Dependency: Add external dependency in your bridge
  • Import Swift-compatible code to Kotlin: Enable SPM dependencies and your own Swift code to be exposed directly in your Kotlin code (if compatible).

Feedback

This project greatly needs feedback, feature requests, and information about the edge case for progressing; let's talk.

Example

A sample is available for people wanted to see the usage.