Laurence Gonsalves
03/29/2024, 1:17 AMProvider<PluginDependency>
(eg <http://libs.plugins.com|libs.plugins.com>.example.some.plugin
) how can I convert this into something suitable to give to implementation()
? This...
implementation(libs.plugins.com.example.some.plugin)
...fails with:
Cannot convert the provided notation to an object of type Dependency: libs.plugins.com.example.some.plugin:1.2.3
ephemient
03/29/2024, 6:34 AMephemient
03/29/2024, 6:35 AMLaurence Gonsalves
03/29/2024, 7:26 AMfun Provider<PluginDependency>.asDependency() =
map { it.asDependency() }
fun PluginDependency.asDependency() : String =
"$pluginId:$pluginId.gradle.plugin:${version.displayName}"
Which can be used like:
dependencies {
implementation(libs.plugins.org.jlleitschuh.gradle.ktlint.asDependency())
}