|-htmlSanityCheck | htmlSanityCheck-gradle-plugin | | |-src | | | |-main | | | | |-org | | | | | |-aim42 | | | | | | |-htmlsanitycheck | | | | | | | |-gradle | | | | | | | | | ... | | | | | | | | |-HtmlSanityCheckPlugin.groovy (1) | | | | | | | | |-HtmlSanityCheckTask.groovy | | | | |-resources | | | | | |-META-INF (2) | | | | | | |-gradle-plugins | | | | | | | |-htmlSanityCheck.properties (3) | | | |-test | | | | |-org | | | | | |-aim42 | | | | | | |-htmlsanitycheck | | | | | | | |-gradle | | | | | | | | | ... | | | | | | | | |-HtmlSanityCheckPluginSpec |
Introduction
Prerequisites
Prerequisites for Gradle Plugin Development
You should definitely read the original Gradle Plugin Development Guide on custom plugin development.
Adding New Checks
To add new checks, you have to subclass from 'org.aim42.htmlsanitycheck.check.Checker' and implement the 'performCheck' method - which requires an 'HtmlPage' instance as parameter.
Remember to:
-
Write a (JUnit) test or (Spock) spec for your checker - the code in htmlSanityCheck-core/src/test/groovy/org/aim42/htmlsanitycheck/check gives many examples
-
Add your checker class to the
public static AllCheckers
list of available checkers. This set is used to configure the 'AllChecksRunner' class.
Directory Structure and Required Files
Core Module
TBD
Gradle Plugin
1 | the actual plugin code, a xyzPlugin and xyzTask groovy files |
2 | Gradle expects plugin properties in META-INF |
3 | Property file containing the name of the actual implementation class:
implementation-class=org.aim42.htmlsanitycheck.gradle.HtmlSanityCheckPlugin |
Notes for IntelliJ Users
If you work with IntelliJ, you should configure your run- and test configurations so that the working-directory is set to your current module - most easily done by making $MODULE_DIR$ your default.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.