Has anyone managed to get a concept of build varia...
# multiplatform
s
Has anyone managed to get a concept of build variants working within the shared code? Specifically my usecase is wanting to define instances of data classes populated with dummy data (for a mock variant of the app) in shared code, but I don't want those to be used in production. Any ideas anyone? 🙏
d
maybe this could cover your use case https://github.com/yshrsmz/BuildKonfig
s
Not really to be honest, unless I'm missunderstanding. I think that solves the problem of wanting configuration in one place , but doesn't solve the problem of wanting multiple source sets within the shared code
l
I don’t have a good solution other than providing the data from the leaf/app module. This way every other module isn’t aware of variants
x
I created a you track issue to address lack of debug variants in common code, but that got immediately shot down
s
@xxfast Do you have a link to the issue? I'd be interested in the response
I am moving this to 'Declined', not because the proposal is bad, but because we will not implement something like this in "the current multiplatform".
We're working together with Google to provide a better mpp+Android integration in the future. This implementation will have source sets completely re-designed and will hopefully satisfy your needs fully!
@Sebastian Sellmair [JB]
my current workaround for this is to extract this to a standalone nested module and include that for android debug variant like
Copy code
debugImplementation(project(":app:debug"))
s
Just to get a better understanding, why is the.
androidDebug
source set not an option for your use case?
s
Because the
androidDebug
source set cannot be accessed from iOS. @xxfast how do you use that module in your iOS / other platforms?
x
that i'm yet to figure out 😅
right now im consuming the debug library in my release build as well - which is generally no go
s
Ah fair enough, my current thinking is trying to do some kind of clever symlinking but it's probably asking for trouble