This message was deleted.
# community-support
s
This message was deleted.
v
Yes, feature variants seem to be what you are after. But afaict there is no standard attribute that it just magically works for the consumer. For
android
vs.
standard-jvm
there is
org.gradle.jvm.environment
that is automatically set by the respective plugins. So the consumer will have to choose the feature variant explicitly I think.
p
I'm ok with that. It wasn't clear to me how to set that on the consumer side. Are you aware of any examples showing how to use custom attributes in this way?
v
I don't think using attribute directly is the right way here, it is one level too low. Use feature variants, they are one level higher.
p
Is there an example of that? I'm not sure what I need to do in my app so that the correct variant is used
p
Capability is a variant?
v
Variants provide capabilities. So by selecting a capability, your select the variant.
p
I think I have been confused my names. I use registerFeature to create a variant which defines attributes which I can match by requesting a capability?
v
A feature variant defines one or more capabilities and also attributes. Different feature variants do not necessarily have different attributes. In your case the variants will have the same attributes but different capabilities and you select a capability on the consumer side. In case of android vs standard JVM, your feature variants would have the same capabilities, but different attributes, so that automatically the right variant is selected.
👍 1