Skip to content

Commit d084f2d

Browse files
committed
minor build clean up
1 parent 012fc4f commit d084f2d

File tree

8 files changed

+31
-36
lines changed

8 files changed

+31
-36
lines changed

build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ buildscript {
2525
classpath gradlePlugins.values()
2626
classpath platforms.collect { platform(it) }
2727

28-
configurations.all { configuration ->
28+
configurations.configureEach { configuration ->
2929
restrictions.each { module, version ->
3030
constraints.add(configuration.name, module).version { require version }
3131
}
@@ -50,7 +50,7 @@ allprojects {
5050
'api', 'apiElements', 'archives', 'compileClasspath', 'compileOnlyApi', 'default',
5151
'implementation', 'javadocElements', 'runtimeClasspath', 'runtimeElements', 'runtimeOnly',
5252
'sourcesElements', 'testCompileClasspath', 'testRuntimeClasspath']
53-
configurations.all { configuration ->
53+
configurations.configureEach { configuration ->
5454
if (name !in ignored) {
5555
restrictions.each { module, version ->
5656
constraints.add(configuration.name, module).version { require version }
@@ -71,7 +71,7 @@ subprojects {
7171
apply from: "${rootDir}/gradle/dependencies.gradle"
7272
apply from: "${rootDir}/gradle/objectLayout.gradle"
7373

74-
configurations.all {
74+
configurations.configureEach {
7575
resolutionStrategy.dependencySubstitution {
7676
substitute module('org.hamcrest:hamcrest-core') using module(testLibraries.hamcrest)
7777
}
@@ -158,9 +158,9 @@ snyk {
158158
}
159159
tasks.named('snyk-test').configure {
160160
notCompatibleWithConfigurationCache(
161-
'The snyk-test task is not compatible with the configuration cache')
161+
"The ${name} task is not compatible with the configuration cache")
162162
}
163163
tasks.named('snyk-monitor').configure {
164164
notCompatibleWithConfigurationCache(
165-
'The snyk-monitor task is not compatible with the configuration cache')
165+
"The ${name} task is not compatible with the configuration cache")
166166
}

caffeine/testing.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ tasks.register('stress', Stresser) {
127127
group = 'Cache tests'
128128
description = 'Executes a stress test'
129129
notCompatibleWithConfigurationCache(
130-
'The stress task is not compatible with the configuration cache')
130+
"The ${name} task is not compatible with the configuration cache")
131131
outputs.upToDateWhen { false }
132132
dependsOn compileTestJava
133133
}

gradle/codeQuality.gradle

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -221,18 +221,20 @@ tasks.withType(Checkstyle).configureEach {
221221
}
222222
}
223223

224-
afterEvaluate {
225-
tasks.findAll { it.name.startsWith('forbiddenApis') }*.configure {
226-
enabled = System.properties.containsKey('forbiddenApis')
227-
}
228-
tasks.findAll { it.name.startsWith('spotbugs') }*.configure {
229-
notCompatibleWithConfigurationCache('Spotbugs is not compatible with the configuration cache')
230-
enabled = System.properties.containsKey('spotbugs')
231-
group = 'SpotBugs'
232-
reports {
233-
html.required = true
234-
sarif.required = true
235-
}
224+
tasks.matching { it.name.startsWith('forbiddenApis') }.configureEach {
225+
notCompatibleWithConfigurationCache(
226+
"The ${name} task is not compatible with the configuration cache")
227+
enabled = System.properties.containsKey('forbiddenApis')
228+
}
229+
230+
tasks.matching { it.name.startsWith('spotbugs') }.configureEach {
231+
notCompatibleWithConfigurationCache(
232+
"The ${name} task is not compatible with the configuration cache")
233+
enabled = System.properties.containsKey('spotbugs')
234+
group = 'SpotBugs'
235+
reports {
236+
html.required = true
237+
sarif.required = true
236238
}
237239
}
238240

gradle/coverage.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ tasks.named('coveralls').configure {
5858
group = 'Coverage reports'
5959
description = 'Uploads the aggregated coverage report to Coveralls'
6060
notCompatibleWithConfigurationCache(
61-
'The coveralls task is not compatible with the configuration cache')
61+
"The ${name} task is not compatible with the configuration cache")
6262
dependsOn jacocoFullReport
6363
onlyIf { System.env.CI }
6464
}

gradle/dependencies.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ ext {
6464
univocityParsers: '2.9.1',
6565
ycsb: '0.17.0',
6666
xz: '1.9',
67-
zstd: '1.5.2-5',
67+
zstd: '1.5.4-1',
6868
]
6969
testVersions = [
7070
awaitility: '4.2.0',

gradle/eclipse.gradle

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@ import org.gradle.plugins.ide.eclipse.model.SourceFolder
88
apply plugin: 'eclipse'
99

1010
// Exclude module-info when compiling through Eclipse
11-
afterEvaluate {
12-
eclipse.classpath.file.whenMerged {
13-
def main = entries.find { it instanceof SourceFolder && it.path == 'src/main/java' }
14-
if (main != null) {
15-
main.excludes.add('module-info.java')
16-
}
11+
eclipse.classpath.file.whenMerged {
12+
def main = entries.find { it instanceof SourceFolder && it.path == 'src/main/java' }
13+
if (main != null) {
14+
main.excludes.add('module-info.java')
1715
}
1816
}
1917

gradle/jmh.gradle

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,11 @@ eclipse.classpath.file.whenMerged {
1717

1818
configurations {
1919
jmh {
20+
extendsFrom testImplementation
2021
exclude module: 'slf4j-test'
2122
}
2223
}
2324

24-
dependencies {
25-
afterEvaluate {
26-
jmh configurations.testImplementation.allDependencies
27-
}
28-
}
29-
3025
tasks.named('jmh').configure {
3126
group = 'Benchmarks'
3227
description = 'Executes a Java microbenchmark'
@@ -91,12 +86,12 @@ jmhReport {
9186

9287
tasks.named('jmhReport').configure {
9388
notCompatibleWithConfigurationCache(
94-
'The jmhReport task is not compatible with the configuration cache')
89+
"The ${name} task is not compatible with the configuration cache")
9590
}
9691

9792
tasks.named('jmhJar').configure {
9893
notCompatibleWithConfigurationCache(
99-
'The jmhJar task is not compatible with the configuration cache')
94+
"The ${name} task is not compatible with the configuration cache")
10095
}
10196

10297
tasks.named('jmh').configure {

simulator/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ tasks.register('simulate', Simulate) {
164164
group 'Application'
165165
description 'Runs multiple simulations and generates an aggregate report'
166166
notCompatibleWithConfigurationCache(
167-
'The simulate task is not compatible with the configuration cache')
167+
"The ${name} task is not compatible with the configuration cache")
168168
dependsOn processResources, compileJava
169169
outputs.upToDateWhen { false }
170170
}
@@ -205,7 +205,7 @@ tasks.register('rewrite', Rewrite) {
205205
group 'Application'
206206
description 'Rewrite traces into the format used by other simulators'
207207
notCompatibleWithConfigurationCache(
208-
'The rewrite task is not compatible with the configuration cache')
208+
"The ${name} task is not compatible with the configuration cache")
209209
dependsOn processResources, compileJava
210210
outputs.upToDateWhen { false }
211211
}

0 commit comments

Comments
 (0)