Hi everyone, I'm trying to setup build flavours/sc...
# multiplatform
m
Hi everyone, I'm trying to setup build flavours/schemes for the KMP project using xcodegen / tuist. I'm facing issues in the iOS side. Can anyone point me to some resource or help me here? I explored BuildKonfig but didn't understand fully how can I this use for my usecase? Thanks
n
Hi @M Saif Ullah, taking a look at this repo should prove helpfull. https://github.com/pererikbergman/multiplatform-flavors An implementation i am working on (more involved project) can be found here https://github.com/ooni/probe-multiplatform
For the iOS section, take a look at https://developer.apple.com/documentation/xcode/customizing-the-build-schemes-for-a-project This should help you create schemes for each flavor. Please be sure to ping me if you get stuck.
m
Thanks a lot @Norbel AMBANUMBEN I'll definitely check it out. Actually my iOS teammates are trying to set this up with xcodegen or tuist. Will ping you if I need more help. Thanks
Does your project use xcodegen or tuist?
n
No, it doesnt. Just created a scheme in xcode and made some tweaks
m
thanks, but my issue is mainly with xcodegen and tuist. Plain schems are working fine but can't get it working with tuist/xcodegen.
p
KMP doesn't promote the concept of flavor but it rather promotes the iOS "target" concept. Put it between "" to not confuse with OS or platform targets. But in general the way you achieve flavors in KMP is by making commonMain to rely on an abstract API that will swap actual/real implementation based on a build configuration property. This way you will have many abstract APIs(call them plugin if you will) which you will combine in "targets" as your custom build demands. So in this case the iOS target concept scales better than Android flavor
n
I would say KMP doesnt have first party support. @M Saif Ullah, i think you can also look at https://github.com/AngeloAvv/flutter_flavorizr/blob/master/assets/scripts/darwin/create_scheme.rb Without more information, i dont know how to help you better.
m
I think the main question is how to manage .pbxproj files for iOS side of things?
n
• What kind of setup do you plan to have? • How are you going about it? • Is there a well documented path you can take to essentially accomplish something similar? cc @M Saif Ullah