icerockdev / moko-socket-io

MOKO SocketIo by IceRock is Socket.IO implementation Kotlin Multiplatform library
https://moko.icerock.dev/
Apache License 2.0
113 stars 19 forks source link

Support for without org.jetbrains.kotlin.native.cocoapods #32

Open ramadhansejati opened 4 months ago

ramadhansejati commented 4 months ago

Please add support for without jetbrains cocoapods

Alex009 commented 4 months ago

hi. without cocoapods plugin you need add manual linking:

kotlin.targets.matching { it is org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget }
    .configureEach {
        val target = this as org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
        target.binaries.matching { it is org.jetbrains.kotlin.gradle.plugin.mpp.Framework }
            .configureEach {
                val framework = this as org.jetbrains.kotlin.gradle.plugin.mpp.Framework
                val frameworks = listOf(
                    project.rootProject.file("path-where-located-mokoSocketIo.framework")
                ).map { "-F${it.path}" }

                framework.linkerOpts(frameworks)
            }
    }