What is IP-safe way of “apply this plugin everywhe...
# community-support
v
What is IP-safe way of “apply this plugin everywhere”? like root, settings, i.e. every .gradle file
e
from settings, you can
gradle.lifecycle.beforeProject
and
.afterProject
but of course you'd have to apply a settings plugin before any of its code runs
from an init script you can
gradle.beforeSettings
and
gradle.settingsEvaluated
and I don't think IP is relevant for that
v
whats an init script?
v
Init script is most probably not what you want. They are not part of the build definition of a project. They are a way to inject build logic into builds without modifying those builds. Use-case are for example IDEs or CIs injecting things into builds they manage.
If you apply a settings plugin which the also applies itself to all projects, you have what you asked for. (The plugin can implement
Plugin<PluginAware>
to be applicable in settings, project, and init scripts)
But as I wrote in the other thread, it might need simpler in your case to just use the worker API and use the defined build scripts, not a pattern.
j
init scripts can be bundled into custom distributions though, so for setting standard org-wide behavior, they can be useful
v
Yes, that's right, missed to mention that use-case. That falls into the "unlikely" category too though. 🙂