Is there difference between Convention and Extension objects?

Hi,

I was wondering, if there’s some simple explanation of difference between concept of Convention objects and Extension objects? i.e.: project.extensions.create vs. project.convention.plugins

Thanks

You should use extensions, as convention plugins might go away at some point.

The primary difference is that extensions effectively add a new property to an object (i.e. an extension). Convention plugins get mixed in to the target object, so all of it’s methods and properties become available on the target.

Convention plugins may seem better at first glance, but in practice they are problematic. Because extensions are like properties, it’s far more obvious when they are being used as opposed to just “magic” methods.

I strongly recommend using extensions.

Thank you for clearing that out. I’ve been looking into some of existing plugins, and I noticed that these two gets often mixed together. It was not clear to me from documentation, how exactly they differ.