https://kotlinlang.org logo
#compose-ios
Title
# compose-ios
d

Dan River

10/23/2023, 1:42 PM
Guys how do we actually add third party ios dependencies to projects that use static linking instead of cocoapods. I can't seem to get cocoapods block in the Gradle DSL anyhow.
j

Jeff Lockhart

10/23/2023, 4:13 PM
I have an example project that links a local framework. And another version that uses CocoaPods for the same framework. If you need Kotlin interop with the dependency, I'm doing this in the main library with CocoaPods for the iOS framework and manual .def for locally linked C lib for Linux and Windows. See the Kotlin docs for details.
d

Dan River

10/23/2023, 4:17 PM
So, for statically linked projects, is the only option cinterop?
j

Jeff Lockhart

10/23/2023, 4:18 PM
Do you need Kotlin interop, or just to link the library?
d

Dan River

10/23/2023, 4:18 PM
I need to use it from the shared code. So kotlin interop is necessary
j

Jeff Lockhart

10/23/2023, 4:19 PM
In my library I'm generating Kotlin interop. The example apps that use my library just need to link the library. If you need Kotlin interop, you'll need both.
👍 1
d

Dan River

10/23/2023, 4:20 PM
Has anyone had success with using static framework for the shared module and coocoapods for third party dependencies
j

Jeff Lockhart

10/23/2023, 4:24 PM
This is my .def file for my locally linked C lib. If all the APIs you need are in the library headers, you don't need to manually define anything below the
---
.
Has anyone had success with using static framework for the shared module and coocoapods for third party dependencies
I don't understand your question.
d

Dan River

10/23/2023, 4:25 PM
Ohh okay. Thanks. I suppose yeah def generation is the better option than forcing cocoapods into a static project
Thanks for the repo. It's a great help
j

Jeff Lockhart

10/23/2023, 4:29 PM
So you're suggesting you want to point the CocoaPods plugin to a local library? If there's a local .podspec, you might be able to do that. But a manual .def file probably aligns better with this use case.
The .def file that the CocoaPods plugin generates for an iOS framework looks like this:
Copy code
language = Objective-C
modules = CouchbaseLite
linkerOpts = -framework CouchbaseLite
d

Dan River

10/23/2023, 4:31 PM
Yep. and yes you're right. Not using cocoapods looks like less headaches in the future
👍 1
3 Views