I am writing a Gradle plugin and I am learning Gradle by reading the user guide and the source code of the plugins inside the Gradle project.
In the source code, I found 2 ways of adding properties to the project:
- Convention (set by the
JavaBasePlugin
and used by theJavaPlugin
) - Extension (set by the
AnnouncePlugin
and used by theBuildAnnouncementsPlugin
).
I don't understand the difference between them and which one to use for which situation. Could someone explain?