Builtin plugins can be applied via a type-safe, tooling-friendly mechanism #168
|
How will this play with our plan to remove all plugins from the distribution itself? How would this help with community plugins? Wouldn't adding yet another syntax just for core plugins add more confusion than benefit? |
|
Q. How will this play with our plan to remove all plugins from the distribution itself? There would still exist a curated list of plugins somewhere. The extensions would be generated off of that list. Q. How would this help with community plugins? This issue is specifically about builtin plugins but a similar solution could (and should) be provided for community plugins. Q. Wouldn't adding yet another syntax just for core plugins add more confusion than benefit? It's not really another syntax for there's no The tradeoffs here are very similar to the ones related to dependency configurations and in that case we decided it made sense to provide extensions for commonly used configurations. |
Just some future considerations: If we really follow through on our modularization goals, that list might be different from distribution to distribution (e.g. "Gradle for Java developers" vs. "Gradle for native developers"). So you might have to generate the extensions as part of the distribution-building process or at runtime. Otherwise you'd risk proposing plugins which then fail to resolve.
I wasn't aware that there is no
Does that mean we auto-complete configurations that are not available? E.g. if I don't apply any plugin I get a proposal for |
Yes, the closer we can make static typing predict runtime behaviour, the better. But it's not like stringly-typed plugin ids couldn't fail to resolve as well, right?
Yes. |
Yes, but the tooling didn't propose them to me. Many people have very high trust in what their IDEs tell them to do (through completion). Proposing things that are not actually there might surprise them. |
|
I think we should separate this story from implementing the basic |
|
The infix/operator notation |
|
@cypressious there's also the That operator is defined here: https://github.com/gradle/gradle-script-kotlin/blob/24d2ab2072e53a68a6e7faf07a79c23f32d339db/src/test/kotlin/org/gradle/script/lang/kotlin/FolderBasedTest.kt#L30 |
Improve the usability of builtin plugins by providing extension members that can be used in the scope of the
pluginsblock:plugins { java application }This should give users the following benefits:
<CTRL+SPACE>within thepluginsblock would cause the IDE to present a list of available plugins)A standalone Kotlin example
Alternatively an infix
+operator could be used as syntactic hook if the UX is considerably improved: