Bradleycorn
08/22/2024, 12:59 PMgitportal pull ....
to get some changes from the kmp repo into the ios app project. In order to use those changes (i.e. get the xcode ide to recognize them and not show errors everywhere), you have to build the whole app first. In my experience, this is somewhat par for the course with Xcode.
Wondering if someone has found a setup to make this a little more efficient? I thought maybe I could create a new scheme that only builds the kmp framework, but (as of yet) I couldn't get that going. Any other options people are aware of?kpgalligan
08/22/2024, 2:13 PMkpgalligan
08/22/2024, 2:16 PMBradleycorn
08/22/2024, 3:03 PMyou can have an intermediate target that would just build the KotlinYeah, something like that would work. If you had that target, you could then setup a scheme to just build that target (i.e. call the embed gradle task) to produce an updated framework. Perhaps I'll look into that.
I think the main target would still need to call the embed Gradle task,That would be fine. Off the top of my head, I would think that would even be desirable. After all, the whole mindset here is that the kotlin code is part of the app, and if I'm building my main app target, it should build the kotlin code, just as it does the swift code. The main goal for this is to just make development cycles a little faster when you are pullin in kotlin code udpates. My experience with ios apps/xcode is that build times are pretty slow, particularly as your app grows to a medium or larger size. So having to build the whole app when I've pulled some kotlin code just to "see" the kotlin updates in the ide editor can be kind of a turn off. If I could pull the kotlin code, run the embed task to build the framework, and then start editing my project, that would probably speed things up ... Come to think of it ... maybe I could just run the embed task from the command line as soon as I pull the updates ... hmm ... might try that.
kpgalligan
08/22/2024, 3:09 PMThe main goal for this is to just make development cycles a little faster when you are pullin in kotlin code udpatesThis is a common pain point. Surprised nobody's had a "this works fairly well" solution, considering how long KMP has been around. Then again, I'm not sure that is a positive sign for finding one 🙂 I will say, if you "build" the iOS app, you don't actually need to "build" the whole thing. You can just hit "build" and it'll run Gradle before Swift compile. Not elegant, but you can stop the build there.