anyone used K/N with CocoaPods? Wondering if there...
# kotlin-native
a
anyone used K/N with CocoaPods? Wondering if theres a way to have a
.podspec
reference the generated
.framework
file K/N outputs
j
It looks possible to automate as a Gradle task. What is your use case for it?
a
interested in this, too. The idea on my end would be to use it to write a KMPP library and have a pure iOS project consume it without needing to worry about where it came from/how it's built
j
Do you plan having a repository for such frameworks? It is only possible to include one K/N produced framework to an app
a
there would still be a single gradle module using konan which produces the framework consumed by the app
i dont actually think any changes need to be made in K/N to implement this, but getting a podspec to run the compileKonan task and depend on the generated framework is less clear
if i generated the framework first, then run
bundle exec pod install
to set up cocoapods, it almost looks like its working (im seeing some linker failures at the moment but that might be my fault)
but ideally they dont need to be done in that order and you can
bundle exec pod install
without the framework being built yet
j
Does one need a repository to install a locally built cocoapod locally? Will it work from a local file?
a
it can be done entirely locally
cocoapods can be set up to build from swift/objc source or source thats hosted elsewhere
but i dont think theres a way to say you’re building from some other type
not sure if that answers your question
j
It does. Thanks. I’ll recheck it. It’d be enough to make it call gradle to build a framework from kotlin sources. One may use gradle to generate pod spec which calls the same gradle to build the framework
t
I think the DroidCon 2018 NYC app used Gradle integration with their K/N iOS app, and it uses Cocoapods.
a
theres a podfile but no gemfile, and the readme suggests cocoapods didnt work so they just checked the pods folder into the repo instead