So I could use this to apply a convention plugin t...
# community-support
c
So I could use this to apply a convention plugin to all of my projects without having them use the plugin block? just making certain I understand. the repositories application though, there's already a better way yes?
Copy code
gradle.lifecycle.beforeProject {
    apply(plugin = "base")
    repositories {
        mavenCentral()
    }
}
v
You could, whether you should is a very different topic. Those isolated projects safe hooks are nice if you for example write an init script, or need to apply a plugin from the settings script. But I personally agree that the repository is better suited in
dependencyResolutionManagement
and imho you should apply the plugins in the projects where you want their effect so that from looking at the project's build script it is clear what is applied.
c
can you deregister a plugin later if needed? I'm not certain it's a good idea, and yet it would reduce some level of code
v
You mean like un-apply - as in reverting the effect of applying it?
No, that would be a door to very deep hells
I don't see that ever come
c
me: gathers party. "To the deep hells!"
you mean gradle isn't event sourced? 😛 I don't know why I thought that could be done...