Jakob Ulbrich
03/11/2026, 4:24 PMcomposeApp1 -> ui-feature-a -> ui-components -> ui-theme-brand1
composeApp2 -> -> ui-theme-brand2
You can find what I already tried in the thread. Is there anything that I haven't thought about yet or any better approach?Jakob Ulbrich
03/11/2026, 4:24 PMui-components module and select them based on Gradle attributes declared in the app modules --> But messing around and duplicating and hiding configurations created by the AGP and KGP seems error prone and fragile
• Using a fixed dependency on ui-theme-brand1 in ui-components, but use a dependency substitution rule in my app modules to enforce the usage of the correct ui-theme-brand module --> This feels a bit hacky
• Using a fixed dependency on ui-theme-brand1 in ui-components. Using the same Gradle capability in my ui-theme-brand modules telling gradle that this is basically the same library, just different implementations. Specifying an explicit dependency on the correct ui-theme-brand module from within the app modules, creating a capability conflict and resolving it with a resolution strategy --> That's what I tend to use now, since both ui-themen-brand modules have in fact the same capability since they share the same api
• Using CompositionLocal to "inject" the correct theme from my app modules, so my ui modules do not need to care about the dependency themselves --> This would work well for compose theme definitions, but creates a lot of overhead since it prevents me from using the Res object directly but instead requires that I write new accessors for my composeResources. Also it prevents me from using android resources in my intermediate ui modules.
• Using a gradle parameter to define which brand to build and select the ui-theme-brand dependency accordingly --> This feels off in terms of Gradle caching and prevents me from building brand1 and brand2 within the same cmd callPablichjenkov
03/11/2026, 5:16 PMJakob Ulbrich
03/12/2026, 7:59 AMPablichjenkov
03/12/2026, 1:54 PMJakob Ulbrich
03/23/2026, 11:40 AM