diff --git a/build.gradle b/build.gradle index 63b48860..230da735 100644 --- a/build.gradle +++ b/build.gradle @@ -71,7 +71,7 @@ configure(subprojects) { name = 'myLocalRepositoryForFullIntegrationTests' //noinspection GrDeprecatedAPIUsage File baseDir = file(project.parent.buildDir) - url = new File (baseDir, "maven-repo") + url = new File(baseDir, "maven-repo") } mavenLocal() } @@ -92,8 +92,30 @@ configure(subprojects) { } } +def groovyVersion = libs.groovy.bom.get().version +def groovyVersionMajorMinor = groovyVersion.split('\\.')[0..1] .join('.') + tasks.named("dependencyUpdates").configure { gradleReleaseChannel = true + + resolutionStrategy { + componentSelection { rules -> + rules.all { ComponentSelection selection -> + if (selection.candidate.version =~ /(alpha|M)/) { + selection.reject('Rejected alpha or milestone version') + } else if (selection.candidate.group == 'org.spockframework') { + def spockGroovyVersion = selection.candidate.version.split('-')[2] + if (spockGroovyVersion != groovyVersionMajorMinor) { + selection.reject("Spock's Groovy version ($spockGroovyVersion) does not match project's Groovy major/minor version ($groovyVersionMajorMinor)") + } + } else if (selection.candidate.group == 'org.codehaus.groovy') { + if (selection.candidate.version != groovyVersion) { + selection.reject("Groovy version is determined by Gradle API (${groovyVersion})") + } + } + } + } + } } sonar { @@ -121,7 +143,7 @@ tasks.register("integrationTestOnly") { } logger.debug "Script output: $result" File integrationTestDirectory = file(INTEGRATION_TEST_DIRECTORY) - final File testIndex = new File (integrationTestDirectory, "build/reports/index.html") + final File testIndex = new File(integrationTestDirectory, "build/reports/index.html") assert testIndex.exists() } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index dd6cba40..0e837d77 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,22 +1,23 @@ [versions] -groovy-version = "3.0.17" -junit5-version = "5.10.1" +groovy-version = '3.0.17' +junit5-version = '5.10.2' +slf4j-version = '2.0.13' [libraries] -commons-validator = "commons-validator:commons-validator:1.8.0" -# Use Groovy which corresponds to Gradle version (of hsc build) -groovy-bom = { module = "org.codehaus.groovy:groovy-bom", version.ref = "groovy-version" } -jsoup = "org.jsoup:jsoup:1.17.2" -junit-vintage = { module = "org.junit.vintage:junit-vintage-engine", version.ref = "junit5-version" } -lombok = "org.projectlombok:lombok:1.18.30" -slf4j-api = "org.slf4j:slf4j-api:2.0.11" -slf4j-nop = "org.slf4j:slf4j-nop:2.0.11" -spock = "org.spockframework:spock-bom:2.3-groovy-3.0" +commons-validator = 'commons-validator:commons-validator:1.8.0' +# Use Groovy which corresponds to a Gradle version (of hsc build) +groovy-bom = { module = 'org.codehaus.groovy:groovy-bom', version.ref = 'groovy-version' } +jsoup = 'org.jsoup:jsoup:1.17.2' +junit-vintage = { module = 'org.junit.vintage:junit-vintage-engine', version.ref = 'junit5-version' } +lombok = 'org.projectlombok:lombok:1.18.32' +slf4j-api = { module = 'org.slf4j:slf4j-api', version.ref = 'slf4j-version' } +slf4j-nop = { module = 'org.slf4j:slf4j-nop', version.ref = 'slf4j-version' } +spock = 'org.spockframework:spock-bom:2.3-groovy-3.0' [plugins] -gradle-versions = { id= "com.github.ben-manes.versions", version = "0.51.0" } -sonar = { id = "org.sonarqube", version = "5.0.0.4638" } -gitProperties = { id = "com.gorylenko.gradle-git-properties", version = "2.4.1" } +gradle-versions = { id= 'com.github.ben-manes.versions', version = '0.51.0' } +sonar = { id = 'org.sonarqube', version = '5.0.0.4638' } +gitProperties = { id = 'com.gorylenko.gradle-git-properties', version = '2.4.1' } # Copyright Gerd Aschemann and aim42 contributors. # diff --git a/htmlSanityCheck-core/build.gradle b/htmlSanityCheck-core/build.gradle index 7ec9d847..b4916369 100644 --- a/htmlSanityCheck-core/build.gradle +++ b/htmlSanityCheck-core/build.gradle @@ -68,12 +68,9 @@ tasks.register('copyResourceImages', Copy) { processResources { dependsOn copyResourceImages, generateGitProperties -// duplicatesStrategy = DuplicatesStrategy.INHERIT - exclude '**/*.png' inputs.property "version", project.version filter ReplaceTokens, tokens: [version: project.version] - println "after processResources config, version= ${project.version}" } /*