Slackbot
11/08/2022, 7:40 AMVampire
11/08/2022, 7:53 AM<plugin id>:<plugin id>.gradle.plugin:<plugin version>
. If you use the plugin exclusively in the convention plugin, just add it as a normal lib entry in the version catalog. Or you can extract the plugin id and version from the accessor and build up the syntax I mentioned.
And of course there is https://github.com/gradle/gradle/issues/17963 to thumbs up and follow.Lars Kaulen
11/08/2022, 8:05 AMVampire
11/08/2022, 8:54 AMChris Lee
11/08/2022, 2:59 PMpublic fun DependencyHandlerScope.plugin(id: String, version: String): String =
"$id:$id.gradle.plugin:$version"
public fun DependencyHandlerScope.plugin(plugin: Provider<PluginDependency>): Provider<String> =
plugin.map { "${it.pluginId}:${it.pluginId}.gradle.plugin:${it.version}" }
settings.gradle.kts
plugin("nullaway", "net.ltgt.nullaway").version("1.3.0")
build.gradle.kts
implementation(plugin(libs.plugins.nullaway))
Chris Lee
11/08/2022, 3:03 PMplugin("nullaway" to "net.ltgt.nullaway:1.3.0")
using:
public fun VersionCatalogBuilder.plugin(alias: Pair<String, String>) {
val (id, version) = alias.second.split(":")
plugin(alias.first, id).version(version)
}