spm4Kmp

Project Url: frankois944/spm4Kmp
Introduction: SPM For KMP: Use Apple Swift packages and sources in a KMP project
More: Author   ReportBugs   OfficialWebsite   
Tags:

spmForKmp logo

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.

You can also easily use your own Swift code to your Kotlin's Apple sourceSet!

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

READ THE DOCUMENTATION

QuickStart

Gradle Plugin

``` kotlin title="build.gradle.kts" plugins { id("org.jetbrains.kotlin.multiplatform") id("io.github.frankois944.spmForKmp") version "[version]" }


## Gradle Properties

``` title="gradle.properties"
kotlin.mpp.enableCInteropCommonization=true

Initial Configuration

kotlin title="build.gradle.kts" kotlin { listOf( iosArm64(), iosSimulatorArm64() // and more Apple targets... ).forEach { target -> // `cinteropName` is recommended when using a list of native target // Or when you want to keep the compatibility with the legacy way (cf: [cinteropName]) // If not set, It will take the name of the current Target target.swiftPackageConfig(cinteropName = "[cinteropName]") { // create a new directory at `src/swift/[cinteropName]` } } }

⭐️ Support My Project ⭐️

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

GitHub stars

ko-fi

Star History

Star History Chart


For additional help or detailed documentation, refer to the official repository or contact the plugin maintainers. Happy coding! 🎉

Apps
About Me
GitHub: Trinea
Facebook: Dev Tools