Skip to content

Commit e24c202

Browse files
committed
chore: Removes unnecessary .configure calls
1 parent 8199b4c commit e24c202

File tree

12 files changed

+23
-36
lines changed

12 files changed

+23
-36
lines changed

dd-java-agent/agent-bootstrap/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plugins {
99
apply from: "$rootDir/gradle/java.gradle"
1010
apply plugin: "idea"
1111

12-
tasks.named("compileJava", JavaCompile).configure {
12+
tasks.named("compileJava", JavaCompile) {
1313
configureCompiler(it, 8, JavaVersion.VERSION_1_8, "Need access to sun.* packages")
1414
}
1515

dd-java-agent/build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def generalShadowJarConfig(ShadowJar shadowJarTask) {
116116

117117
def includeShadowJar(TaskProvider<ShadowJar> includedShadowJarTask, String destinationDir) {
118118
def opentracingFound = new AtomicBoolean()
119-
project.processResources {
119+
project.tasks.named("processResources", ProcessResources) {
120120
doFirst {
121121
eachFile {
122122
// We seem unlikely to use this name somewhere else.
@@ -147,9 +147,7 @@ def includeShadowJar(TaskProvider<ShadowJar> includedShadowJarTask, String desti
147147
}
148148
}
149149
}
150-
}
151150

152-
project.tasks.named("processResources") {
153151
dependsOn includedShadowJarTask
154152
}
155153

dd-java-agent/instrumentation/jersey/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ tasks.named("compileJersey3JettyTestGroovy", GroovyCompile) {
2323
javaLauncher = getJavaLauncherFor(11)
2424
}
2525

26-
compileTestJava.configure {
26+
tasks.named("compileTestJava") {
2727
configureCompiler(it, 11, JavaVersion.VERSION_11)
2828
}
2929

dd-smoke-tests/appsec/springboot-grpc/build.gradle

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ tasks.withType(Test).configureEach {
3030

3131
def shadowJarTask = project(':dd-smoke-tests:springboot-grpc').tasks.named('shadowJar', ShadowJar)
3232

33-
jvmArgumentProviders.add({
34-
["-Ddatadog.smoketest.appsec.springboot-grpc.shadowJar.path=${shadowJarTask.get().archiveFile.get()}"]
33+
jvmArgumentProviders.add(new CommandLineArgumentProvider() {
34+
@Override
35+
Iterable<String> asArguments() {
36+
return shadowJarTask.map { ["-Ddatadog.smoketest.appsec.springboot-grpc.shadowJar.path=${it.archiveFile.get()}"] }.get()
37+
}
3538
})
3639
}

dd-smoke-tests/play-2.4/build.gradle

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,9 @@ tasks.withType(ScalaCompile).configureEach {
8787
configureCompiler(it, 8)
8888
}
8989

90-
tasks.withType(AbstractCopyTask).each {
90+
tasks.withType(AbstractCopyTask).configureEach {
9191
// Don't know why the play plugin tries to copy the logback.xml file twice, but only accept it once
92-
it.configure {
93-
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
94-
}
92+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
9593
}
9694

9795
spotless {

dd-smoke-tests/play-2.5/build.gradle

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,9 @@ tasks.withType(ScalaCompile).configureEach {
8989
configureCompiler(it, 8)
9090
}
9191

92-
tasks.withType(AbstractCopyTask).each {
92+
tasks.withType(AbstractCopyTask).configureEach {
9393
// Don't know why the play plugin tries to copy the logback.xml file twice, but only accept it once
94-
it.configure {
95-
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
96-
}
94+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
9795
}
9896

9997
spotless {

dd-smoke-tests/play-2.6/build.gradle

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,9 @@ tasks.withType(ScalaCompile).configureEach {
8989
configureCompiler(it, 8)
9090
}
9191

92-
tasks.withType(AbstractCopyTask).each {
92+
tasks.withType(AbstractCopyTask).configureEach {
9393
// Don't know why the play plugin tries to copy the logback.xml file twice, but only accept it once
94-
it.configure {
95-
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
96-
}
94+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
9795
}
9896

9997
spotless {

dd-smoke-tests/play-2.7/build.gradle

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,9 @@ tasks.withType(ScalaCompile).configureEach {
8989
configureCompiler(it, 8)
9090
}
9191

92-
tasks.withType(AbstractCopyTask).each {
92+
tasks.withType(AbstractCopyTask).configureEach {
9393
// Don't know why the play plugin tries to copy the logback.xml file twice, but only accept it once
94-
it.configure {
95-
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
96-
}
94+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
9795
}
9896

9997
spotless {

dd-smoke-tests/play-2.8-otel/build.gradle

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,9 @@ tasks.withType(ScalaCompile).configureEach {
8585
configureCompiler(it, 8)
8686
}
8787

88-
tasks.withType(AbstractCopyTask).each {
88+
tasks.withType(AbstractCopyTask).configureEach {
8989
// Don't know why the play plugin tries to copy the logback.xml file twice, but only accept it once
90-
it.configure {
91-
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
92-
}
90+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
9391
}
9492

9593
spotless {

dd-smoke-tests/play-2.8-split-routes/build.gradle

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,9 @@ tasks.withType(ScalaCompile).configureEach {
8585
configureCompiler(it, 8)
8686
}
8787

88-
tasks.withType(AbstractCopyTask).each {
88+
tasks.withType(AbstractCopyTask).configureEach {
8989
// Don't know why the play plugin tries to copy the logback.xml file twice, but only accept it once
90-
it.configure {
91-
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
92-
}
90+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
9391
}
9492

9593
spotless {

0 commit comments

Comments
 (0)