Skip to content

Instantly share code, notes, and snippets.

@raphiz
Created February 19, 2025 10:20
Show Gist options
  • Save raphiz/2de8ad9bf5d30bafc66243ec4ed11c9c to your computer and use it in GitHub Desktop.
Save raphiz/2de8ad9bf5d30bafc66243ec4ed11c9c to your computer and use it in GitHub Desktop.
Use plugin versions from version catalog with precompiled script plugins
plugins {
id "groovy-gradle-plugin"
}
dependencies {
implementation pluginDependency(libs.plugins.kotlin)
// ...
}
// See https://github.com/gradle/gradle/issues/28371#issuecomment-2002003698
static Provider<Map<String, String>> pluginDependency(Provider<PluginDependency> notation){
return notation.map { plugin ->
[
"group" : plugin.pluginId,
"name" : "${plugin.pluginId}.gradle.plugin",
"version": plugin.version.requiredVersion
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment