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

saket

04/22/2020, 4:59 AM
Along the same lines: now that I’m starting to develop for macOS, I’ve noticed that none neither the official guides nor the other blogs talk about the feedback loop for native development with KMP. When changes to the common module is made, they can be used immediately from JVM or Android modules. That does not seem to be the case for native platforms. I have to rebuild my macOS project from xcode everytime to see new changes. Is that expected?
c

curioustechizen

04/22/2020, 5:41 AM
Atleast for iOS projects in XCode this has also been my experience. My understanding is that if you make any change in the shared KMP code, the . framework file needs to be regenerated fom XCode to be able to see it. And the trigger to regenerate it is to build in XCode.
s

saket

04/22/2020, 5:52 AM
Considering that there’s a kotlin native plugin for appcode, I’d expect it to work without relying on xcode 🤔 https://blog.jetbrains.com/kotlin/2019/04/kotlinnative-support-for-appcode-2019-1/
👍 1
I really like that AppCode generates a
.swift
version of
.h
files that is super easy to read. Unfortunately, those
.swift
files don’t get updated when the shared headers file are updated. They’re only updated when I close and re-open my project.
c

curioustechizen

04/22/2020, 6:03 AM
XCode generates that too. And it does get updated when you rebuild the framework
s

saket

04/22/2020, 6:04 AM
Huh. Selecting
Jump to definition
in xcode takes me to the extremely unreadable
.h
file. How do you generate a
.swift
file out of it?
c

curioustechizen

04/22/2020, 6:06 AM
It is somewhat hidden. Click on the quadrant looking thing at the top left of the editor (to the right of the project explorer panel). There you have "Generated interfaces"
I'm pretty sure I totally butchered all the XCode and iOS terminology in that one message but 🤷‍♂️
s

saket

04/22/2020, 6:08 AM
Found it. But it doesn’t stay permanently active. Cmd+clicking a shared API will always take me to its
.h
source. sad.gif.
c

curioustechizen

04/22/2020, 6:09 AM
Ah yes right.
s

saket

04/22/2020, 7:32 PM
I gave up and created an issue on youtrack in hopes for a solution: https://youtrack.jetbrains.com/issue/OC-20012
👍 1