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 an alternative of the dying CocoaPods Plugin used by KMP cocoapods plugin.

It will help you to integrate Swift Package and simplify communication between Swift/Kotlin Multiplatform projects targeting the Apple platform.

The plugin uses the embedded Swift Package Manager, so no third-party dependency is needed, and it's less intrusive than CocoaPods.

Please Be Aware

Pure Swift packages can't be exported to Kotlin; the plugin will help you to create a bridge to bypass this issue.

It's a manual job, but until the Swift-import is (not currently planned) available in KMP, it's the only way.

Features

  • Create a Swift<->Kotlin bridge: Import your own Swift code for functionality that can't be done in Kotlin.
  • Use SPM third-Party Dependency: Add external dependency and use it inside 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).

Support My Project ⭐️

If you find this project useful, please consider giving it a star!

GitHub stars

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.