I am building a Gradle project containing multiple convention plugins and using Sharing build logic in a multi-repo setup Sample as inspiration.
Publishing those convention plugins and using them in different projects is working fine. But when I want to apply one of those convention plugins in the root build.gradle.kts, I have to first publish that convention plugin and then include it like a regular plugin.
My project structure is as follows:
convention-plugins
├── build.gradle.kts
├── settings.gradle.kts
├── src
│ ├── main
│ │ └── kotlin
│ │ └── some.package
│ │ ├── publishing.gradle.kts
│ │ └── download-git-hooks.gradle.kts
When I want to apply one of those plugins, I first have to publish the plugin (for example with publishToMavenLocal). I can then use the plugin in the plugins-block:
plugins {
id("some.package.publishing") version("1.0.0-SNAPSHOT")
id("some.package.download-git-hooks") version("1.0.0-SNAPSHOT")
}
Having to publish a plugin before being able to use it in the root build.gradle.kts is quite tedious and suboptimal.
Is there a way to apply those convention plugins without having to publish them first?