Skip to content

Commit b733cda

Browse files
Simplify Groovy compilation. (#9866)
1 parent 4a1b258 commit b733cda

File tree

7 files changed

+14
-27
lines changed

7 files changed

+14
-27
lines changed

dd-java-agent/instrumentation/aerospike-4.0/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@ muzzle {
1313

1414
apply from: "$rootDir/gradle/java.gradle"
1515

16-
1716
addTestSuiteForDir("latestDepTest", "test")
1817
addTestSuiteForDir("latest7DepTest", "test")
1918
addTestSuiteExtendingForDir("latestDepForkedTest", "latestDepTest", "test")
2019
addTestSuiteExtendingForDir("latest7DepForkedTest", "latest7DepTest", "test")
2120

22-
2321
dependencies {
2422
compileOnly group: 'com.aerospike', name: 'aerospike-client', version: '4.0.0'
2523

dd-java-agent/instrumentation/armeria/armeria-jetty-1.24/build.gradle

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@ addTestSuiteForDir("jetty11Test", "test/jetty11")
2525
addTestSuiteExtendingForDir("jetty9LatestDepTest", "latestDepTest", "test/jetty9")
2626
addTestSuiteExtendingForDir("jetty11LatestDepTest", "latestDepTest", "test/jetty11")
2727

28-
["compileJetty11TestGroovy", "compileJetty11LatestDepTestGroovy"].each { name ->
29-
tasks.named(name, GroovyCompile) {
30-
configureCompiler(it, 11)
31-
}
32-
}
28+
configureGroovyCompiler(11, "compileJetty11TestGroovy", "compileJetty11LatestDepTestGroovy")
3329

3430
["jetty11Test", "jetty11LatestDepTest"].each { name ->
3531
tasks.named(name, Test) {

dd-java-agent/instrumentation/axis2-1.3/build.gradle

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ configurations.configureEach {
2323
}
2424
}
2525

26-
["compileLatestDepForkedTestGroovy", "compileLatestDepTestGroovy"].each {
27-
tasks.named(it, GroovyCompile) {
28-
configureCompiler(it, 11)
29-
}
30-
}
26+
configureGroovyCompiler(11, "compileLatestDepForkedTestGroovy", "compileLatestDepTestGroovy")
3127

3228
["compileLatestDepForkedTestJava", "compileLatestDepTestJava"].each {
3329
tasks.named(it, JavaCompile) {

dd-java-agent/instrumentation/cxf-2.1/build.gradle

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,17 @@ tasks.named("compileCxf3LatestDepTestJava", JavaCompile) {
2727
configureCompiler(it, 11, JavaVersion.VERSION_1_8)
2828
}
2929

30+
configureGroovyCompiler(11, "compileCxf3LatestDepTestGroovy")
31+
3032
tasks.named("compileLatestDepTestJava", JavaCompile) {
3133
configureCompiler(it, 17, JavaVersion.VERSION_1_8)
3234
}
3335

34-
tasks.named("compileLatestDepTestGroovy", GroovyCompile) {
35-
configureCompiler(it, 17)
36-
}
37-
3836
tasks.named("latestDepTest", Test) {
3937
javaLauncher = getJavaLauncherFor(17)
4038
}
4139

42-
tasks.named("compileCxf3LatestDepTestGroovy", GroovyCompile) {
43-
configureCompiler(it, 11)
44-
}
40+
configureGroovyCompiler(17, "compileLatestDepTestGroovy")
4541

4642
tasks.named("cxf3LatestDepTest", Test) {
4743
javaLauncher = getJavaLauncherFor(11)

dd-java-agent/instrumentation/spring/spring-boot-1.3/build.gradle

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,7 @@ addTestSuiteExtendingForDir("boot2LatestDepForkedTest", "boot2LatestDepTest", "t
3131
addTestSuiteExtendingForDir("boot3ForkedTest", "boot3Test", "test")
3232
addTestSuiteExtendingForDir("latestDepForkedTest", "latestDepTest", "test")
3333

34-
["compileLatestDepTestGroovy", "compileBoot3TestGroovy"].each { name ->
35-
tasks.named(name, GroovyCompile) {
36-
configureCompiler(it, 17)
37-
}
38-
}
34+
configureGroovyCompiler(17, "compileLatestDepTestGroovy", "compileBoot3TestGroovy")
3935

4036
dependencies {
4137
implementation project(':dd-java-agent:instrumentation:span-origin')

dd-smoke-tests/gradle/build.gradle

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import java.time.Duration
2-
import java.time.temporal.ChronoUnit
3-
41
plugins {
52
id 'com.gradleup.shadow'
63
}

gradle/java_no_deps.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,14 @@ ext.configureCompiler = (AbstractCompile it, int toolchainVersion, JavaVersion c
403403
}
404404
} as Closure<Void>
405405

406+
ext.configureGroovyCompiler = (int toolchainVersion, String... taskNames) -> {
407+
taskNames.each { taskName ->
408+
tasks.named(taskName, GroovyCompile) {
409+
configureCompiler(it, toolchainVersion)
410+
}
411+
}
412+
} as Closure<Void>
413+
406414
ext.getJavaLauncherFor = (javaVersionInteger) -> {
407415
def launcher = javaToolchains.launcherFor {
408416
languageVersion = JavaLanguageVersion.of(javaVersionInteger)

0 commit comments

Comments
 (0)