Gradle Plugin Concept and Development
Description
You should definitely read the original [Gradle User Guide] on custom plugin development.
To enable the required Gradle integration, we implement a lean wrapper as described in the Gradle user guide.
class HtmlSanityCheckPlugin implements Plugin<Project> {
void apply(Project project) {
project.task('htmlSanityCheck',
type: HtmlSanityCheckTask,
group: 'Check')
}
}
Directory Structure and Required Files
|-htmlSanityCheck
| |-src
| | |-main
| | | |-org
| | | | |-aim42
| | | | | |-htmlsanitycheck
| | | | | | | ...
| | | | | | |-HtmlSanityCheckPlugin.groovy (1)
| | | | | | |-HtmlSanityCheckTask.groovy
| | | |-resources
| | | | |-META-INF (2)
| | | | | |-gradle-plugins
| | | | | | |-htmlSanityCheck.properties (3)
| | |-test
| | | |-org
| | | | |-aim42
| | | | | |-htmlsanitycheck
| | | | | | | ...
| | | | | | |-HtmlSanityCheckPluginTest
|
- the actual plugin code: HtmlSanityCheckPlugin and HtmlSanityCheckTask groovy files
- Gradle expects plugin properties in META-INF
- Property file containing the name of the actual implementation class:
Passing Parameters From Buildfile to Plugin
To be done
Building the Plugin
The plugin code itself is built with Gradle.
Uploading to Public Archives
To be done