Created
February 19, 2025 10:20
-
-
Save raphiz/2de8ad9bf5d30bafc66243ec4ed11c9c to your computer and use it in GitHub Desktop.
Use plugin versions from version catalog with precompiled script plugins
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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