This message was deleted.
# kotlin-dsl
s
This message was deleted.
1
v
I don't think so, especially as capabilities are not necessarily following that default naming pattern and you don't necessarily want the main variant when consuming a feature variant.
Btw., it is unnecessary to repeat the version on the capability.
But if you really want such a possibility, you could probably make a helper extension function relatively easily.
i
Indeed, I ended up using:
Copy code
fun DependencyHandlerScope.implementation(dependency: String, withCapability: String, vararg withCapabilities: String) = listOf(
    implementation(dependency),
    *listOf(withCapability, *withCapabilities).map {
        implementation(dependency) {
            capabilities {
                requireCapability("$group:$name-$it:$version")
            }
        }
    }.toTypedArray())
👌 1