Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section
titleDescription

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.

Code Block
languagegroovy
class HtmlSanityCheckPlugin implements Plugin<Project> {
  void apply(Project project) {
    project.task('htmlSanityCheck',
            type: HtmlSanityCheckTask,
            group: 'Check')
  }
}
  
Content Marker
id
Content
Section
titleDirectory Structure and Required Files
Code Block
languagetext
|-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
   |
  1. the actual plugin code: HtmlSanityCheckPlugin and HtmlSanityCheckTask groovy files
  2. Gradle expects plugin properties in META-INF
  3. Property file containing the name of the actual implementation class:
Section
titlePassing Parameters From Buildfile to Plugin

To be done

Section
titleBuilding the Plugin

The plugin code itself is built with gradle.

Section
titleUploading to Public Archives

To be done

Section
titleFurther Information on Creating Gradle Plugins

Although writing plugins is described in the Gradle user guide, a clearly explained sample is given in a Code4Reference tutorial.

Section
titleMotivation
Section
level2
titleQuality Scenarios
Display Table
doctypequality-scenario
render-no-hits-as-blanktrue
selectName, Short Description
restrict-to-immediate-childrentrue
empty-as-nonetrue
Section
level2
titleUse Cases
Display Table
doctypeuse-case
render-no-hits-as-blanktrue
selectName, Short Description
sort-bySort Key, Name
restrict-to-immediate-childrentrue
empty-as-nonetrue
Section
titleSolution
Section
level2
titleConstraints
Display Table
doctypeproject-constraint
render-no-hits-as-blanktrue
selectName, Short Description
sort-bySort Key, Name
restrict-to-immediate-childrentrue
empty-as-nonetrue
Section
level2
titleDecisions
Display Table
doctypearchitecture-decision
render-no-hits-as-blanktrue
selectName, Short Description
sort-bySort Key, Name
restrict-to-immediate-childrentrue
empty-as-nonetrue
Section
titleApplication

Section
titleDiscussion

...