Skip to content

Commit

Permalink
Move Gradle classes to gradle package
Browse files Browse the repository at this point in the history
  • Loading branch information
ascheman committed Sep 18, 2024
1 parent 9307f2e commit 5374aa3
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 15 deletions.
2 changes: 1 addition & 1 deletion htmlSanityCheck-gradle-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ gradlePlugin {
plugins {
htmlSanityCheck {
id = 'org.aim42.htmlSanityCheck'
implementationClass = 'org.aim42.htmlsanitycheck.HtmlSanityCheckPlugin'
implementationClass = 'org.aim42.htmlsanitycheck.gradle.HtmlSanityCheckPlugin'
displayName = 'Gradle HtmlSanityCheck Plugin'
description = project.description
tags = ["checks", "quality", "documentation", "html", "asciidoctor", "test"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// see end-of-file for license information

package org.aim42.htmlsanitycheck
package org.aim42.htmlsanitycheck.gradle

import org.gradle.api.Plugin
import org.gradle.api.Project
Expand All @@ -13,7 +13,7 @@ class HtmlSanityCheckPlugin implements Plugin<Project> {

void apply(Project project) {

project.task( HTML_SANITY_CHECK,
project.tasks.register( HTML_SANITY_CHECK,
type: HtmlSanityCheckTask,
description: "performs semantic checks on html files",
group: LifecycleBasePlugin.VERIFICATION_GROUP)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.aim42.htmlsanitycheck
package org.aim42.htmlsanitycheck.gradle

import org.aim42.htmlsanitycheck.AllChecksRunner
import org.aim42.htmlsanitycheck.Configuration
import org.aim42.htmlsanitycheck.check.AllCheckers
import org.gradle.api.DefaultTask
import org.gradle.api.GradleException
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.aim42.htmlsanitycheck
package org.aim42.htmlsanitycheck.gradle

import org.junit.Rule
import org.junit.rules.TemporaryFolder
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package org.aim42.htmlsanitycheck
package org.aim42.htmlsanitycheck.gradle


import org.gradle.api.Project
import org.gradle.language.base.plugins.LifecycleBasePlugin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.aim42.htmlsanitycheck
package org.aim42.htmlsanitycheck.gradle


import org.gradle.testkit.runner.GradleRunner
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.aim42.htmlsanitycheck
package org.aim42.htmlsanitycheck.gradle

import org.aim42.htmlsanitycheck.MisconfigurationException
import org.gradle.api.GradleException
import org.gradle.api.Project
import org.gradle.testfixtures.ProjectBuilder
Expand Down
2 changes: 1 addition & 1 deletion src/docs/arc42/chapters/chap-08-gradle-plugin.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ we implement a lean wrapper as described in the Gradle user guide.

[source, groovy]
----
include::{gradle-plugin-source-path}/htmlsanitycheck/HtmlSanityCheckPlugin.groovy[tag=gradle-plugin-implementation]
include::{gradle-plugin-source-path}/htmlsanitycheck/gradle/HtmlSanityCheckPlugin.groovy[tag=gradle-plugin-implementation]
----

==== Directory Structure and Required Files
Expand Down
14 changes: 8 additions & 6 deletions src/docs/development/development-intro.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ TBD
| | | | |-org
| | | | | |-aim42
| | | | | | |-htmlsanitycheck
| | | | | | | | ...
| | | | | | | |-HtmlSanityCheckPlugin.groovy // <1>
| | | | | | | |-HtmlSanityCheckTask.groovy
| | | | | | | |-gradle
| | | | | | | | | ...
| | | | | | | | |-HtmlSanityCheckPlugin.groovy // <1>
| | | | | | | | |-HtmlSanityCheckTask.groovy
| | | | |-resources
| | | | | |-META-INF // <2>
| | | | | | |-gradle-plugins
Expand All @@ -63,15 +64,16 @@ TBD
| | | | |-org
| | | | | |-aim42
| | | | | | |-htmlsanitycheck
| | | | | | | | ...
| | | | | | | |-HtmlSanityCheckPluginTest
| | | | | | | |-gradle
| | | | | | | | | ...
| | | | | | | | |-HtmlSanityCheckPluginSpec
|
----
<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.HtmlSanityCheckPlugin
implementation-class=org.aim42.htmlsanitycheck.gradle.HtmlSanityCheckPlugin

==== Notes for IntelliJ Users
If you work with IntelliJ, you should configure your run- and test configurations
Expand Down

0 comments on commit 5374aa3

Please sign in to comment.