This release improves the gradlePlugin
extension by introducing a new dependencies
feature. This simplifies the declaration of dependencies by organizing them into declarable buckets, enhancing support for version catalogues and improving code completion. Additionally, test suites received significant improvements.
The gradlePlugin.dependencies
extension is designed to clarify intent compared to using project.dependencies
. Configuring implementation
dependencies with the project DependencyHandler
targets the main
source set, which may be misleading if developers configure the gradlePlugin.pluginSourceSet
. We maintain clear intentions by deferring dependencies configuration until pluginSourceSet
is finalized thanks to the dependencies
extension. Future versions will assert consistency if pluginSourceSet
changes unexpectedly.
Additionally, new dependency types for plugin authors allow easier and more stable dependencies on other plugins. Instead of knowing a plugin's Maven coordinates, you can now use gradlePlugin('<plugin-id>:<version>')
, which returns an ExternalModuleDependency
to the plugin JAR:
gradlePlugin {
dependencies {
implementation(gradlePlugin("com.example.my-plugin:4.2"))
}
}
dependencies {
compileOnly(gradlePlugin("com.example.my-plugin:4.2"))
}