https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
o

oleksandr.stepanov

04/25/2019, 9:12 AM
Hello everyone 👋 I am struggling with next task: I want to build CocoaPods dependencies from sources to be used in Kotlin module. Suppose there is an iOS app project with CocoaPods set up and Pods directory inside with sources to compile frameworks. I want to add
cinterops
dependency to the
build.gradle
of common module, so it makes Pods accessible for Kotlin code in iOS module, compiles and links with Pods frameworks. This is almost done in https://github.com/RubyLichtenstein/Kotlin-Multiplatform-Firebase repo for Firebase Pod, however they link against pre-compiled framework placed in c_interop/firestore directory. What I need, is to build these frameworks as part of gradle build step and link against them while creating Kotlin framework for iOS. If anybody has succeeded with such task, could you, please, share the sample project? Thanks.
s

svyatoslav.scherbina

04/25/2019, 10:56 AM
Is there an issue making new CocoaPods integration unusable in your case? https://kotlinlang.org/docs/reference/native/cocoapods.html#interoperability
👍 1
o

oleksandr.stepanov

04/25/2019, 11:12 AM
I though CocoaPods plugin allows to wrap framework made from Kotlin in a pod and import to an iOS app as dependency. Looks like it works in opposite way too. Will give it a try. Thanks a lot!
👍 1
@svyatoslav.scherbina, another question regarding this plugin: when Kotlin framework is imported as pod, is it recompiling every time you make build in XCode? I mean, if I change something in iOS project, in .swift file, and want to build, should I wait for Kotlin framework to re-build as well?
s

svyatoslav.scherbina

04/25/2019, 11:18 AM
another question regarding this plugin: when Kotlin framework is imported as pod, is it recompiling every time you make build in XCode?
It shouldn’t.
o

oleksandr.stepanov

04/25/2019, 11:19 AM
Cool, and what is the state of progressive compiling for KN nowadays? I have seen in some repo it may be enabled as experimental feature.
s

svyatoslav.scherbina

04/25/2019, 11:22 AM
What do you mean by “progressive compiling”?
o

oleksandr.stepanov

04/25/2019, 11:24 AM
I mean if I change one line of code, it doesn’t re-compile everything next time, unless I clear build folder.
s

svyatoslav.scherbina

04/25/2019, 11:32 AM
This is “incremental compilation”. If you mean one line of Kotlin code, then it is not available for Kotlin/Native yet.
o

oleksandr.stepanov

04/25/2019, 11:39 AM
yes, that’s what I meant. Are there any plans/ETA for this feature, do you know?
Anyway, thank you very much for your answers!
s

svyatoslav.scherbina

04/25/2019, 1:15 PM
You are welcome!
Are there any plans/ETA for this feature, do you know?
We properly understand the importance of this feature and consider implementing it, but have no ETA.
👍 1