Guys how do we actually add third party ios depend...
# compose-ios
d
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
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
So, for statically linked projects, is the only option cinterop?
j
Do you need Kotlin interop, or just to link the library?
d
I need to use it from the shared code. So kotlin interop is necessary
j
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
Has anyone had success with using static framework for the shared module and coocoapods for third party dependencies
j
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
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
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
Yep. and yes you're right. Not using cocoapods looks like less headaches in the future
👍 1