Dear people! Just wanted to let you know I was working on making my own flavoring for KMP 🙂 It is called Kameleon. Basically, I took big inspiration from Android flavoring to get a similar result with kmp and compose multiplatform resources.
What it does:
• Lets you define flavor dimensions and the flavors themselves (not build type)
• merge strings from multiplatform resources based on this. It should use the same merging rules as aapt2
• it should also overwrite drawables and such just like aapt2, but I have to say I didn't check that YET
• allows custom code for specific flavors, just like android
• Integrates with Android flavoring -> if you have that, it will take that as source of truth for that module
• Also allows build config fields to be injected (simple primitive values) by generating a config class
• Your builds are configurable with the by putting the flavor dimensions in your gradle.properties OR pass it as -Pkameleon.flavor.<dimension>=whatever when building
• For some standard commands (like kmp jvm-project:run) we create some helper task: jvm-project:runMyFlavor
• I also made an intellij plugin that helps you with a drop down, which in term will also sync with any AGP build variant selector and mark your sourcesets based on selected flavor
Here is a video -> Is anyone interested in more? I am planning to upload it to github at a point in time and publish the gradle plugin and the intellij plugin (even though guarantees for the stability of the latter is hard to give, and my time is limited)
It works on android, browser (wasmJs) and desktop. By lack of having a macbook, I cannot make any guarantees on that end, but in theory it should work as well.