If I'm writing a plugin that is meant to be applie...
# community-support
e
If I'm writing a plugin that is meant to be applied to every project, and most projects will configure the plugin identically, is it better to: A. Have a root plugin that defines a service configured by an extension that sets the defaults for all other projects to use B. Have the plugin look for a configuration file in the root project directory C. Something else
🅰️ 1
I'd prefer not to use a convention plugin to handle this
t
I think I'd go with A but as a settings plugin (rather than a project plugin to apply to the root project)
1
e
Would a settings plugin cause the project plugin to be on the classpath already, or would I need to specify the version twice?
v
If you have both in the same artifact it would be on the classpath already and even complain if you specify a version even if it were the same as Gradle only tracks which plugin is applied to which project for the "it is the same version so don't complain" check. On the other hand, as it is available through a parent classloader, you then have accessors for your plugins generated, so instead of
plugins { id("my.own.plugin") }
you can then do
plugins { my.own.plugin }
including code completion and so on.
e
Thanks!