Gitportal question ... You do `gitportal pull .......
# touchlab-tools
b
Gitportal question ... You do
gitportal 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?
k
So, essentially just rebuild the Kotlin? Over the last few years there's been an ongoing "how do we improve this?" discussion. I don't know of any non "build the Kotlin" solution right now, but it would be cool if we could just generate the headers. Anyway, to your question. Like just an xcode target to build that wouldn't try to build the Swift as well? Maybe. Haven't really thought about that.
I forget the name of it, but you can have an intermediate target that would just build the Kotlin. It would need to: • Pass the right architecture and build type options • I think the main target would still need to call the embed Gradle task, although that would take some experimenting and maybe digging into the Kotlin Gradle plugin code
b
you can have an intermediate target that would just build the Kotlin
Yeah, 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.
k
The main goal for this is to just make development cycles a little faster when you are pullin in kotlin code udpates
This 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.