>>> Why should plugin authors not use extra properties? And why should build >>> script authors use extra properties, but plugin authors use extensions? > >> Because it makes for confusing build scripts. >> >> If the author (or thereabouts) added the property then they aren't likely to >> be confused by it in a build script. If a plugin adds dynamic properties, >> there's no hint at all where it's coming from in the build script. You have >> to rely on either reading the source code or it's (usually non existent) >> documentation. Moreover, it will be easier to aid plugin authors here by >> generating documentation for extension classes which is going to be >> difficult for extra properties. > > I don't mean to get between you 2 in this conversation :) but some > thoughts... > 1. I agree with Luke that we should make sure usage of a plugin by build > masters is not confusing > 2. I agree with Adam that we should be careful where we create a non-unified > approach for plugin creators and script masters > > It appears to me that the issue that Luke is most interested in solving is > reducing confusion by the user of a plugin (please correct if I'm off)
I'd say that's of equal importance with having a clear distinction to plugin authors between the two approaches. I think by being dogmatic here we save plugin authors from having to decide between the two for the most case. Extensions provide a better user experience all things considered so we should encourage authors of plugins/code that is intended for a wide/unknown audience to use them. > ... this would be best handled by adding CLI discoverability IMO. So when > I'm looking for a property... I use gradle properties. There are a number > of issues with it (for a long term solution). I don't follow at all here. > 1st: there is no name space > 2nd: It would be nice to know who was responsible for that properties... > perhaps even grouped... like core, script, plugin-a, etc. > 3rd: it would be nice at some point to allow meta-data on these properties... > so without reading the source, you can ask gradle for help on this property > and it will be what ever (if anything ) that an author provided. This is one > of the important enablers of a healthy plugin eco-system IMO This is entirely the point of using extensions. They are namespaced and you can typically deduce the source of the extensions from the namespace. > So in the end... I'm for allowing plugin authors to create ext properties... > but the current solution doesn't make that a friendly option. We'll never disallow it. What I'm saying is that we should strongly encourage plugin authors not to do it. -- Luke Daley Principal Engineer, Gradleware http://gradleware.com
