ankushg
10/06/2021, 7:33 PMquizlet-kmp
and quizlet-ios
). Our current approach is that `quizlet-kmp`'s CI builds the framework and publishes it to our private spec repo. iOS folks can then just pull the latest version.
Problem:
This approach has worked fine for us for the past while, but some issues with this approach that are starting to get annoying are:
1. It takes a lot of time to iterate within KMP and test the change on iOS. Having to push, wait for a release to be published, update your podfile, etc is time consuming. We want an opt-in way to allow iOS folks to develop using locally checked out KMP sources.
2. We can't drop breakpoints into the KMP code to debug issues on iOS. My understanding is that this is impossible to do unless you've built the code locally.
What we're thinking:
1. The official Kotlin/Native Cocoapods Plugin seems to address issue 1 if we use it in an opt-in way (defaulting to CI builds instead).
2. Touchlab's xcode-kotlin plugin for Xcode seems to address issue 2 if the framework is built locally (and I think it's designed to be used alongside the cocoapods plugin?)
Both of the examples for these tools are using a monorepo setup though. Has anyone gotten them working with separate, independent repos?
I think I should be able to get the cocoapods plugin working by pointing the ios app's Podfile
to the absolute path of `quizlet-kmp`'s generated Podspec (regardless of directory). This could be conditionally done for every iOS engineer, since the Podfile is just a ruby script.
I also think the xcode-kotlin plugin should also allow me to drag in files from any arbitrary directory.
I'd love to hear if anyone else has done so and can confirm!Mark Schisler
10/06/2021, 7:37 PMMark Schisler
10/06/2021, 7:37 PMankushg
10/06/2021, 7:55 PMMark Schisler
10/06/2021, 8:15 PMMark Schisler
10/06/2021, 8:16 PMrusshwolf
10/06/2021, 8:44 PMMark Schisler
10/06/2021, 9:30 PMankushg
10/06/2021, 10:31 PMWhen you're making changes to the shared code, you can toggle to the local version, point it to wherever the shared code lives locally, and have it build from gradle the way the default cocoapods integration works.Yup, this is exactly what I'm hoping to set up! Just wanted to make sure that both xcode-kotlin and the default cocoapods integration work with arbitrary absoluate paths, rather than somewhere in the same hierarchy as the actual iOS xcode project
akapanina
10/07/2021, 9:10 AMKonstantin Tskhovrebov
10/07/2021, 9:25 AMkpgalligan
10/07/2021, 11:29 AMkpgalligan
10/07/2021, 11:33 AM|-devfolder
| |-quizlet-ios
| |-quizlet-kmp
kpgalligan
10/07/2021, 11:34 AMkpgalligan
10/07/2021, 11:38 AMkpgalligan
10/07/2021, 11:41 AM../quizlet-kmp
which doesn't exist on your drive, the project should still build, but that's frustrating. Cocoapods as of a couple years ago did not have a way to just reference a file/folder. I was either source that needed to be built, or a resource that would be packaged into your build, so you can't just have "extra files" in a podspec, unless something has changed.kpgalligan
10/07/2021, 11:41 AMkpgalligan
10/07/2021, 11:42 AMI don’t know about xcode-kotlinIt's barely a plugin. Even if we wanted to do crazy things, Xcode is pretty locked down. The "plugin" tell Xcode that
kt
files are source, which means you can put breakpoints on them in the IDE, and adds a color definition, so you get some source coloring. After that, it's basically a lightly modified version of the lldb script that ships with Kotlin native.kpgalligan
10/07/2021, 11:50 AMkpgalligan
10/07/2021, 11:51 AMpo
calls on the command line and have reasonable visual debugging performance, but some day soon we'll have to figure that out (https://github.com/touchlab/xcode-kotlin/issues/18)kpgalligan
10/07/2021, 11:51 AMKonstantin Tskhovrebov
10/07/2021, 12:47 PMkpgalligan
10/07/2021, 4:36 PMankushg
10/07/2021, 7:32 PMbasher
10/07/2021, 7:41 PMpath: '../path_to_pod_repo_root'
ankushg
10/07/2021, 8:43 PMkpgalligan
10/07/2021, 8:47 PMankushg
10/07/2021, 9:01 PMsvyatoslav.scherbina
10/18/2021, 12:19 PMthe Kotlin compiler puts absolute file paths for debugging info.We have a compiler flag to change this. See https://youtrack.jetbrains.com/issue/KT-39670
The lldb script in kotlin native was optimized for command line. You’d ask it to print an object, and it would walk the whole graph.I believe we’ve changed this a while ago.
kpgalligan
10/18/2021, 4:30 PMI believe we’ve changed this a while ago.I think I mentioned a bit above, it's been a while since we synced the lldb script we use for Xcode with the one in main source. It's on our near term list of todos. I had't actually used debugging in a while, but I tried it recently and the experience in Android Studio has improved considerably.