hi, does anyone know if KMP supports gradle <featu...
# gradle
s
hi, does anyone know if KMP supports gradle feature variants? they are the recommended way to do optional dependencies, and I'd like to look at using them in some of my projects, however I'd like to make sure they're supported by KMP, as some of my projects with optional dependencies use them. ideally, I'd be able to use feature variants on both common targets (eg. a feature variant which applies to all platforms, such as optional support for another kotlin library) as well as a platform target (eg. a feature variant which applies only to the jvm platform, such as optional support for a specific java library)
t
No, it does not support
s
are there any plans to support it? it feels like an incredibly useful feature, especially things like allowing multiple mutually exclusive feature variants where one is required (eg. "you must use a database, it does not matter which one, but you cannot use multiple")
t
Kind of related: https://youtrack.jetbrains.com/issue/KT-33432/MPP-build-variant-feature Though no near-term plans to address it.
s
hmmm, I'm not sure if this is fully related as I believe that android build variants are different from library feature variants and don't use the same underlying apis.