This message was deleted.
# plugin-development
s
This message was deleted.
v
You mean
PluginManager.withPlugin
I guess, as
withId
does not exist. 🙂
k
Yes
v
That would then probably be
plugins.withType
, while the JavaDoc of
plugins
says:
While not deprecated, it is preferred to use the methods of this interface or the {@link #getPluginManager() plugin manager} than use the plugin container.
But if you really need by type, that's probably the way to go.
Btw. I'm curious, why do you prefix all questions with "QQ:"? You're the only one I know doing this, and practically all posts here are questions in one way or another anyway. 😄
k
That does seem to be a rough edge; I can imagine that, for complex plugins, you have a collection of smaller plugins with no IDs that you want to apply in a way that reordering the order they are applied won't break things.
"QQ" is for "quick question"
v
Well, you could give them IDs, but - especially if this is within your plugin project - I guess using type is fine. I guess using by id is usually preferred as then it can work, whehter the plugin in question is on the classpath at all or not either way.
k
I think the orthodoxy here is that "IDs are for plugins that you expect other people to apply", so a plugin that doesn't have one is for "internal use only", even though it doesn't really matter to Gradle anyways. I think I was expecting some kind of symmetry, but it could be just me.
v
Yeah, well, as I said,
plugins.withType
is probably what you are after. 🙂