I can imagine a plugin to generate the plugin-descriptor. This plugin would allow to write plugins without having to maintain the plugin.properties file in META-INF/gradle-plugins.
If this plugin would also add compile dependencies to gradleApi() and localGroovy(), the minimal build.gradle of a plugin build would just be
apply plugin: 'gradle-plugin'
I am currently thinking about building a prototype of such a plugin. But unless this plugin is part of gradle, the above would also need a buildscript-block with entries for repositories and dependencies. Therefore I would suggest adding this functionality to the bundled plugins.
My first implementation will not do any classloading, but will only do convention-based generation.
- All .class files in the classes folder ending with Plugin.class and not beginning with Abstract will be considered. - For the plugin-name, the first char is converted to lowercase, all subsequent uppercase characters are replaced by the lowercase character with prefix ‘-’
- AbstractFooPlugin will not be processed - FooBarPlugin will result in a file META-INF/gradle-plugins/foo-bar.properties
What do you think?