From d5969f67af96b972c45785f0bdfa73968fef916a Mon Sep 17 00:00:00 2001 From: Gerd Aschemann Date: Mon, 15 Jan 2024 18:35:41 +0100 Subject: [PATCH] WIP Move test libraries for CLI to libs --- gradle/libs.versions.toml | 7 ++++++- htmlSanityCheck-cli/build.gradle | 10 +++++----- htmlSanityCheck-core/build.gradle | 6 ++++-- htmlSanityCheck-gradle-plugin/build.gradle | 2 +- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 74af55de..db76e76f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,7 @@ [versions] groovy-version = "3.0.20" picocli-version = "4.7.5" +jupiter-version = "5.10.1" [libraries] # Use Groovy which corresponds to Gradle version (of hsc build) @@ -9,11 +10,15 @@ groovy-all = { module = "org.codehaus.groovy:groovy-all", version.ref = "groovy- groovy-dateutil = { module = "org.codehaus.groovy:groovy-dateutil", version.ref = "groovy-version" } jsoup = "org.jsoup:jsoup:1.17.2" junit = "junit:junit:4.13.2" +jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "jupiter-version" } +jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "jupiter-version" } +mockito = "org.mockito:mockito-junit-jupiter:5.9.0" picocli-impl = { module = 'info.picocli:picocli', version.ref = "picocli-version" } picocli-annotationprocessor = { module = 'info.picocli:picocli-codegen', version.ref = "picocli-version" } slf4j-api = "org.slf4j:slf4j-simple:2.0.7" slf4j-simple = "org.slf4j:slf4j-simple:2.0.7" -spock = "org.spockframework:spock-core:2.3-groovy-3.0" +spock-core = "org.spockframework:spock-core:2.3-groovy-3.0" +spock-reports = "com.athaydes:spock-reports:2.5.0-groovy-3.0" [plugins] gradle-versions = { id= "com.github.ben-manes.versions", version = "0.50.0" } diff --git a/htmlSanityCheck-cli/build.gradle b/htmlSanityCheck-cli/build.gradle index 5d16e1f3..5ee0437a 100644 --- a/htmlSanityCheck-cli/build.gradle +++ b/htmlSanityCheck-cli/build.gradle @@ -16,11 +16,11 @@ dependencies { implementation project(":htmlSanityCheck-core") - testImplementation 'org.spockframework:spock-core:2.3-groovy-3.0' - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.1' - testImplementation 'org.mockito:mockito-junit-jupiter:3.11.2' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.1' - testImplementation( "com.athaydes:spock-reports:2.5.0-groovy-3.0" ) + testImplementation libs.spock.core + testImplementation libs.jupiter.api + testImplementation libs.mockito + testRuntimeOnly libs.jupiter.engine + testImplementation libs.spock.reports } compileGroovy { diff --git a/htmlSanityCheck-core/build.gradle b/htmlSanityCheck-core/build.gradle index 82e1a27d..6fb03edd 100644 --- a/htmlSanityCheck-core/build.gradle +++ b/htmlSanityCheck-core/build.gradle @@ -1,7 +1,9 @@ +import org.apache.tools.ant.filters.ReplaceTokens + dependencies { testImplementation( libs.junit, - libs.spock, + libs.spock.core, libs.slf4j.simple ) @@ -27,7 +29,7 @@ processResources { exclude '**/*.png' inputs.property "version", project.version - filter(org.apache.tools.ant.filters.ReplaceTokens, tokens: [version: project.version]) + filter(ReplaceTokens, tokens: [version: project.version]) println "after processResources config, version= ${project.version}" } diff --git a/htmlSanityCheck-gradle-plugin/build.gradle b/htmlSanityCheck-gradle-plugin/build.gradle index ac05b353..0af3509c 100755 --- a/htmlSanityCheck-gradle-plugin/build.gradle +++ b/htmlSanityCheck-gradle-plugin/build.gradle @@ -1,7 +1,7 @@ dependencies { testImplementation( libs.junit, - libs.spock, + libs.spock.core, gradleTestKit() )