If they would publish feature variants that are designed for it, maybe.
If not, then I don’t think so.
Or at least I don’t have an idea right away, short of dirty things like letting Gradle resolve it, iterate over the resolution result, and then doing the according dependencies or component metadata rules if possible.
But that might not even work properly.