diff --git a/build.gradle b/build.gradle index 1a8cef909c..5ba3c9e429 100644 --- a/build.gradle +++ b/build.gradle @@ -25,7 +25,7 @@ buildscript { classpath gradlePlugins.values() classpath platforms.collect { platform(it) } - configurations.all { configuration -> + configurations.configureEach { configuration -> restrictions.each { module, version -> constraints.add(configuration.name, module).version { require version } } @@ -50,7 +50,7 @@ allprojects { 'api', 'apiElements', 'archives', 'compileClasspath', 'compileOnlyApi', 'default', 'implementation', 'javadocElements', 'runtimeClasspath', 'runtimeElements', 'runtimeOnly', 'sourcesElements', 'testCompileClasspath', 'testRuntimeClasspath'] - configurations.all { configuration -> + configurations.configureEach { configuration -> if (name !in ignored) { restrictions.each { module, version -> constraints.add(configuration.name, module).version { require version } @@ -71,7 +71,7 @@ subprojects { apply from: "${rootDir}/gradle/dependencies.gradle" apply from: "${rootDir}/gradle/objectLayout.gradle" - configurations.all { + configurations.configureEach { resolutionStrategy.dependencySubstitution { substitute module('org.hamcrest:hamcrest-core') using module(testLibraries.hamcrest) } @@ -158,9 +158,9 @@ snyk { } tasks.named('snyk-test').configure { notCompatibleWithConfigurationCache( - 'The snyk-test task is not compatible with the configuration cache') + "The ${name} task is not compatible with the configuration cache") } tasks.named('snyk-monitor').configure { notCompatibleWithConfigurationCache( - 'The snyk-monitor task is not compatible with the configuration cache') + "The ${name} task is not compatible with the configuration cache") } diff --git a/caffeine/testing.gradle b/caffeine/testing.gradle index 6028c44196..88b714d641 100644 --- a/caffeine/testing.gradle +++ b/caffeine/testing.gradle @@ -127,7 +127,7 @@ tasks.register('stress', Stresser) { group = 'Cache tests' description = 'Executes a stress test' notCompatibleWithConfigurationCache( - 'The stress task is not compatible with the configuration cache') + "The ${name} task is not compatible with the configuration cache") outputs.upToDateWhen { false } dependsOn compileTestJava } diff --git a/gradle/codeQuality.gradle b/gradle/codeQuality.gradle index 775b7bb81a..8de4ed1cdc 100644 --- a/gradle/codeQuality.gradle +++ b/gradle/codeQuality.gradle @@ -221,18 +221,20 @@ tasks.withType(Checkstyle).configureEach { } } -afterEvaluate { - tasks.findAll { it.name.startsWith('forbiddenApis') }*.configure { - enabled = System.properties.containsKey('forbiddenApis') - } - tasks.findAll { it.name.startsWith('spotbugs') }*.configure { - notCompatibleWithConfigurationCache('Spotbugs is not compatible with the configuration cache') - enabled = System.properties.containsKey('spotbugs') - group = 'SpotBugs' - reports { - html.required = true - sarif.required = true - } +tasks.matching { it.name.startsWith('forbiddenApis') }.configureEach { + notCompatibleWithConfigurationCache( + "The ${name} task is not compatible with the configuration cache") + enabled = System.properties.containsKey('forbiddenApis') +} + +tasks.matching { it.name.startsWith('spotbugs') }.configureEach { + notCompatibleWithConfigurationCache( + "The ${name} task is not compatible with the configuration cache") + enabled = System.properties.containsKey('spotbugs') + group = 'SpotBugs' + reports { + html.required = true + sarif.required = true } } diff --git a/gradle/coverage.gradle b/gradle/coverage.gradle index 5ba66c18b0..762d0a193a 100644 --- a/gradle/coverage.gradle +++ b/gradle/coverage.gradle @@ -58,7 +58,7 @@ tasks.named('coveralls').configure { group = 'Coverage reports' description = 'Uploads the aggregated coverage report to Coveralls' notCompatibleWithConfigurationCache( - 'The coveralls task is not compatible with the configuration cache') + "The ${name} task is not compatible with the configuration cache") dependsOn jacocoFullReport onlyIf { System.env.CI } } diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index 2782bfcc8d..d45148ddba 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -64,7 +64,7 @@ ext { univocityParsers: '2.9.1', ycsb: '0.17.0', xz: '1.9', - zstd: '1.5.2-5', + zstd: '1.5.4-1', ] testVersions = [ awaitility: '4.2.0', diff --git a/gradle/eclipse.gradle b/gradle/eclipse.gradle index 522ff1b647..942ddf399d 100644 --- a/gradle/eclipse.gradle +++ b/gradle/eclipse.gradle @@ -8,12 +8,10 @@ import org.gradle.plugins.ide.eclipse.model.SourceFolder apply plugin: 'eclipse' // Exclude module-info when compiling through Eclipse -afterEvaluate { - eclipse.classpath.file.whenMerged { - def main = entries.find { it instanceof SourceFolder && it.path == 'src/main/java' } - if (main != null) { - main.excludes.add('module-info.java') - } +eclipse.classpath.file.whenMerged { + def main = entries.find { it instanceof SourceFolder && it.path == 'src/main/java' } + if (main != null) { + main.excludes.add('module-info.java') } } diff --git a/gradle/jmh.gradle b/gradle/jmh.gradle index 66c8988c12..65e01bf51b 100644 --- a/gradle/jmh.gradle +++ b/gradle/jmh.gradle @@ -17,16 +17,11 @@ eclipse.classpath.file.whenMerged { configurations { jmh { + extendsFrom testImplementation exclude module: 'slf4j-test' } } -dependencies { - afterEvaluate { - jmh configurations.testImplementation.allDependencies - } -} - tasks.named('jmh').configure { group = 'Benchmarks' description = 'Executes a Java microbenchmark' @@ -91,12 +86,12 @@ jmhReport { tasks.named('jmhReport').configure { notCompatibleWithConfigurationCache( - 'The jmhReport task is not compatible with the configuration cache') + "The ${name} task is not compatible with the configuration cache") } tasks.named('jmhJar').configure { notCompatibleWithConfigurationCache( - 'The jmhJar task is not compatible with the configuration cache') + "The ${name} task is not compatible with the configuration cache") } tasks.named('jmh').configure { diff --git a/simulator/build.gradle b/simulator/build.gradle index 8fd272d2ec..549652ca8b 100644 --- a/simulator/build.gradle +++ b/simulator/build.gradle @@ -164,7 +164,7 @@ tasks.register('simulate', Simulate) { group 'Application' description 'Runs multiple simulations and generates an aggregate report' notCompatibleWithConfigurationCache( - 'The simulate task is not compatible with the configuration cache') + "The ${name} task is not compatible with the configuration cache") dependsOn processResources, compileJava outputs.upToDateWhen { false } } @@ -205,7 +205,7 @@ tasks.register('rewrite', Rewrite) { group 'Application' description 'Rewrite traces into the format used by other simulators' notCompatibleWithConfigurationCache( - 'The rewrite task is not compatible with the configuration cache') + "The ${name} task is not compatible with the configuration cache") dependsOn processResources, compileJava outputs.upToDateWhen { false } }