diff --git a/build.gradle b/build.gradle index 2dee2c85..9f485642 100644 --- a/build.gradle +++ b/build.gradle @@ -162,7 +162,8 @@ configure(subprojects) { description "${rootProject.description} - Module ${project.name}" dependencies { - implementation platform (libs.slf4j.bom) + implementation platform(libs.groovy.bom) + implementation platform(libs.slf4j.bom) testImplementation platform(libs.spock) testImplementation "org.spockframework:spock-core" @@ -295,6 +296,7 @@ tasks.register("integrationTestOnly") { final String INTEGRATION_TEST_DIRECTORY = "integration-test" final String INTEGRATION_TEST_DIRECTORY_GRADLE_PLUGIN = "${INTEGRATION_TEST_DIRECTORY}/gradle-plugin" final String INTEGRATION_TEST_DIRECTORY_CLI = "${INTEGRATION_TEST_DIRECTORY}/cli" + static void cleanBuild(String baseDirectory) { File integrationTestBuildDir = new File("${baseDirectory}/${Project.DEFAULT_BUILD_DIR_NAME}") if (integrationTestBuildDir.exists()) { @@ -359,7 +361,7 @@ integrationTestCli.dependsOn( ':htmlSanityCheck-cli:installDist' ) integrationTestCli.configure { - shouldRunAfter (':htmlSanityCheck-cli:check') + shouldRunAfter(':htmlSanityCheck-cli:check') } tasks.register("cleanIntegrationTestCli", Delete) { group("Build") diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 44c87dfa..20eef11b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,9 +5,12 @@ slf4j-version = '2.0.16' [libraries] commons-validator = 'commons-validator:commons-validator:1.9.0' +# Use latest 3.x Groovy Version to use Spock for Groovy 3 as long as Gradle uses Groovy 3 +groovy-bom = 'org.codehaus.groovy:groovy-bom:3.0.22' jsoup = 'org.jsoup:jsoup:1.18.1' junit-vintage = { module = 'org.junit.vintage:junit-vintage-engine', version.ref = 'junit5-version' } lombok = 'org.projectlombok:lombok:1.18.34' +mockito = "org.mockito:mockito-junit-jupiter:3.12.4" picocli-impl = { module = 'info.picocli:picocli', version.ref = "picocli-version" } picocli-annotationprocessor = { module = 'info.picocli:picocli-codegen', version.ref = "picocli-version" } slf4j-bom = { module = "org.slf4j:slf4j-bom", version.ref = "slf4j-version" } diff --git a/htmlSanityCheck-cli/build.gradle b/htmlSanityCheck-cli/build.gradle index 3fdcdf4b..7cb7fb88 100644 --- a/htmlSanityCheck-cli/build.gradle +++ b/htmlSanityCheck-cli/build.gradle @@ -6,6 +6,7 @@ dependencies { implementation libs.picocli.impl annotationProcessor libs.picocli.annotationprocessor + implementation 'org.codehaus.groovy:groovy' implementation 'org.slf4j:slf4j-api' implementation 'org.slf4j:slf4j-simple' diff --git a/htmlSanityCheck-cli/src/main/groovy/org/aim42/htmlsanitycheck/cli/Main.groovy b/htmlSanityCheck-cli/src/main/groovy/org/aim42/htmlsanitycheck/cli/Main.groovy index ed5b080e..09dcc169 100644 --- a/htmlSanityCheck-cli/src/main/groovy/org/aim42/htmlsanitycheck/cli/Main.groovy +++ b/htmlSanityCheck-cli/src/main/groovy/org/aim42/htmlsanitycheck/cli/Main.groovy @@ -2,6 +2,7 @@ package org.aim42.htmlsanitycheck.cli import org.aim42.htmlsanitycheck.AllChecksRunner import org.aim42.htmlsanitycheck.Configuration +import org.aim42.htmlsanitycheck.check.AllCheckers import org.slf4j.Logger import org.slf4j.LoggerFactory import picocli.CommandLine @@ -87,12 +88,13 @@ class Main implements Runnable { System.exit(1) } - var configuration = new Configuration() - configuration.addConfigurationItem(Configuration.ITEM_NAME_sourceDir, main.srcDir) - configuration.addConfigurationItem(Configuration.ITEM_NAME_sourceDocuments, srcDocuments) - var resultsDirectory = new File(main.resultsDirectoryName) - configuration.addConfigurationItem((Configuration.ITEM_NAME_checkingResultsDir), resultsDirectory) + var configuration = Configuration.builder() + .sourceDir(main.srcDir) + .sourceDocuments(srcDocuments as Set) + .checkingResultsDir(resultsDirectory) + .checksToExecute(AllCheckers.CHECKER_CLASSES) + .build() if (configuration.isValid()) { // create output directory for checking results diff --git a/htmlSanityCheck-core/build.gradle b/htmlSanityCheck-core/build.gradle index 908b532f..03f0417d 100644 --- a/htmlSanityCheck-core/build.gradle +++ b/htmlSanityCheck-core/build.gradle @@ -9,8 +9,6 @@ dependencies { // Having a vulnerability here ... exclude group: 'commons-collections', module: 'commons-collections' } - implementation libs.slf4j.api - testImplementation libs.slf4j.nop implementation 'org.slf4j:slf4j-api' testImplementation 'org.slf4j:slf4j-nop' // jsoup is our awesome html parser, see jsoup.org diff --git a/integration-test/gradle-plugin/build.gradle b/integration-test/gradle-plugin/build.gradle index 419fe027..f5cb0214 100644 --- a/integration-test/gradle-plugin/build.gradle +++ b/integration-test/gradle-plugin/build.gradle @@ -68,7 +68,7 @@ buildReadmeGradlePlugin.dependsOn(buildReadmeRoot) //buildReadmeGradlePlugin.dependsOn(copyReadmeResources) htmlSanityCheck { - sourceDir file("build/docs") + sourceDir = file("../common/src/test/resources") checkingResultsDir = file("build/reports") failOnErrors = true