diff --git a/dd-java-agent/agent-profiling/profiling-controller-jfr/build.gradle b/dd-java-agent/agent-profiling/profiling-controller-jfr/build.gradle index a82f51b2529..97825a377af 100644 --- a/dd-java-agent/agent-profiling/profiling-controller-jfr/build.gradle +++ b/dd-java-agent/agent-profiling/profiling-controller-jfr/build.gradle @@ -32,7 +32,7 @@ excludedClassesCoverage += ['com.datadog.profiling.controller.jfr.JdkTypeIDs'] // Shared JFR implementation. The earliest Java version JFR is working on is Java 8 -tasks.named("compileTestJava") { +tasks.named("compileTestJava", JavaCompile) { setJavaVersion(it, 11) // tests should be compiled in Java 8 compatible way sourceCompatibility = JavaVersion.VERSION_1_8 diff --git a/dd-java-agent/instrumentation/akka/akka-actor-2.5/build.gradle b/dd-java-agent/instrumentation/akka/akka-actor-2.5/build.gradle index 10bbc03bc92..09adfee54b6 100644 --- a/dd-java-agent/instrumentation/akka/akka-actor-2.5/build.gradle +++ b/dd-java-agent/instrumentation/akka/akka-actor-2.5/build.gradle @@ -18,7 +18,7 @@ apply from: "$rootDir/gradle/test-with-scala.gradle" addTestSuite('akka23Test') addTestSuiteForDir('latestDepTest', 'test') -tasks.named("compileAkka23TestGroovy") { +tasks.named("compileAkka23TestGroovy", GroovyCompile) { classpath += files(sourceSets.akka23Test.scala.classesDirectory) } @@ -41,7 +41,7 @@ sourceSets { } } } -tasks.named("compileLatestDepTestGroovy") { +tasks.named("compileLatestDepTestGroovy", GroovyCompile) { classpath += files(sourceSets.latestDepTest.scala.classesDirectory) } diff --git a/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.6/build.gradle b/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.6/build.gradle index ea656042aae..bd84546c308 100644 --- a/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.6/build.gradle +++ b/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.6/build.gradle @@ -43,21 +43,27 @@ repositories { addTestSuiteForDir('latestDepTest', 'test') -[compileMain_java11Java, compileTestScala, compileLatestDepTestScala].each { - it.configure { +tasks.named("compileMain_java11Java", JavaCompile) { + setJavaVersion(it, 11) + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} + +["compileTestScala", "compileLatestDepTestScala"].each { name -> + tasks.named(name, ScalaCompile) { setJavaVersion(it, 11) sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } } -compileTestGroovy { +tasks.named("compileTestGroovy", GroovyCompile) { javaLauncher = getJavaLauncherFor(11) dependsOn compileTestScala classpath += files(compileTestScala.destinationDirectory) } -compileLatestDepTestGroovy { +tasks.named("compileLatestDepTestGroovy", GroovyCompile) { javaLauncher = getJavaLauncherFor(11) dependsOn compileLatestDepTestScala classpath += files(compileLatestDepTestScala.destinationDirectory) diff --git a/dd-java-agent/instrumentation/armeria/armeria-jetty-1.24/build.gradle b/dd-java-agent/instrumentation/armeria/armeria-jetty-1.24/build.gradle index a45616567a1..e6e9c6bc505 100644 --- a/dd-java-agent/instrumentation/armeria/armeria-jetty-1.24/build.gradle +++ b/dd-java-agent/instrumentation/armeria/armeria-jetty-1.24/build.gradle @@ -25,8 +25,14 @@ addTestSuiteForDir("jetty11Test", "test/jetty11") addTestSuiteExtendingForDir("jetty9LatestDepTest", "latestDepTest", "test/jetty9") addTestSuiteExtendingForDir("jetty11LatestDepTest", "latestDepTest", "test/jetty11") -[compileJetty11TestGroovy, jetty11Test, compileJetty11LatestDepTestGroovy, jetty11LatestDepTest].each { - it.configure { +["compileJetty11TestGroovy", "compileJetty11LatestDepTestGroovy"].each { name -> + tasks.named(name, GroovyCompile) { + javaLauncher = getJavaLauncherFor(11) + } +} + +["jetty11Test", "jetty11LatestDepTest"].each { name -> + tasks.named(name, Test) { javaLauncher = getJavaLauncherFor(11) } } diff --git a/dd-java-agent/instrumentation/axis2-1.3/build.gradle b/dd-java-agent/instrumentation/axis2-1.3/build.gradle index eeb498f73f8..31104cb7f28 100644 --- a/dd-java-agent/instrumentation/axis2-1.3/build.gradle +++ b/dd-java-agent/instrumentation/axis2-1.3/build.gradle @@ -23,14 +23,14 @@ configurations.configureEach { } } -[compileLatestDepForkedTestGroovy, compileLatestDepTestGroovy].each { - it.configure { +["compileLatestDepForkedTestGroovy", "compileLatestDepTestGroovy"].each { name -> + tasks.named(name, GroovyCompile) { javaLauncher = getJavaLauncherFor(11) } } -[compileLatestDepForkedTestJava, compileLatestDepTestJava].each { - it.configure { +["compileLatestDepForkedTestJava", "compileLatestDepTestJava"].each { name -> + tasks.named(name, JavaCompile) { setJavaVersion(it, 11) } } diff --git a/dd-java-agent/instrumentation/cxf-2.1/build.gradle b/dd-java-agent/instrumentation/cxf-2.1/build.gradle index 1ff25265864..9487abb50c0 100644 --- a/dd-java-agent/instrumentation/cxf-2.1/build.gradle +++ b/dd-java-agent/instrumentation/cxf-2.1/build.gradle @@ -23,32 +23,32 @@ apply from: "${rootDir}/gradle/java.gradle" addTestSuite('latestDepTest') addTestSuiteForDir('cxf3LatestDepTest', 'test') -[compileCxf3LatestDepTestJava].each { - it.configure { - setJavaVersion(it, 11) - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } +tasks.named("compileCxf3LatestDepTestJava", JavaCompile) { + setJavaVersion(it, 11) + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } -[compileLatestDepTestJava].each { - it.configure { - setJavaVersion(it, 17) - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } +tasks.named("compileLatestDepTestJava", JavaCompile) { + setJavaVersion(it, 17) + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } -[compileLatestDepTestGroovy, latestDepTest].each { - it.configure { - javaLauncher = getJavaLauncherFor(17) - } +tasks.named("compileLatestDepTestGroovy", GroovyCompile) { + javaLauncher = getJavaLauncherFor(17) } -[compileCxf3LatestDepTestGroovy, cxf3LatestDepTest].each { - it.configure { - javaLauncher = getJavaLauncherFor(11) - } +tasks.named("latestDepTest", Test) { + javaLauncher = getJavaLauncherFor(17) +} + +tasks.named("compileCxf3LatestDepTestGroovy", GroovyCompile) { + javaLauncher = getJavaLauncherFor(11) +} + +tasks.named("cxf3LatestDepTest", Test) { + javaLauncher = getJavaLauncherFor(11) } dependencies { diff --git a/dd-java-agent/instrumentation/exception-profiling/build.gradle b/dd-java-agent/instrumentation/exception-profiling/build.gradle index 070f65df6bc..8b1eee82cc7 100644 --- a/dd-java-agent/instrumentation/exception-profiling/build.gradle +++ b/dd-java-agent/instrumentation/exception-profiling/build.gradle @@ -19,11 +19,13 @@ dependencies { } // Must use Java 11 to build JFR enabled code - there is no JFR in OpenJDK 8 (revisit once JFR in Java 8 is available) -[compileMain_java11Java, compileTestJava].each { - setJavaVersion(it, 11) - it.sourceCompatibility = JavaVersion.VERSION_1_8 - it.targetCompatibility = JavaVersion.VERSION_1_8 - it.options.compilerArgs.addAll(['-Xlint:all,-processing,-options,-path']) +["compileMain_java11Java", "compileTestJava"].each { name -> + tasks.named(name, JavaCompile) { + setJavaVersion(it, 11) + it.sourceCompatibility = JavaVersion.VERSION_1_8 + it.targetCompatibility = JavaVersion.VERSION_1_8 + it.options.compilerArgs.addAll(['-Xlint:all,-processing,-options,-path']) + } } forbiddenApisMain_java11 { diff --git a/dd-java-agent/instrumentation/finatra-2.9/build.gradle b/dd-java-agent/instrumentation/finatra-2.9/build.gradle index 971fcf8e604..7435c01382c 100644 --- a/dd-java-agent/instrumentation/finatra-2.9/build.gradle +++ b/dd-java-agent/instrumentation/finatra-2.9/build.gradle @@ -35,12 +35,12 @@ dependencies { latestDepTestImplementation group: 'com.twitter', name: 'finatra-http_2.11', version: '+' } -tasks.named("compileLatestDepTestGroovy") { +tasks.named("compileLatestDepTestGroovy", GroovyCompile) { classpath = classpath.plus(files(compileLatestDepTestScala.destinationDirectory)) dependsOn "compileLatestDepTestScala" } -tasks.named("compileLatestPre207TestGroovy") { +tasks.named("compileLatestPre207TestGroovy", GroovyCompile) { classpath = classpath.plus(files(compileLatestPre207TestScala.destinationDirectory)) dependsOn "compileLatestPre207TestScala" } diff --git a/dd-java-agent/instrumentation/graal/native-image/build.gradle b/dd-java-agent/instrumentation/graal/native-image/build.gradle index b34f14ea3ba..77e61eddb5f 100644 --- a/dd-java-agent/instrumentation/graal/native-image/build.gradle +++ b/dd-java-agent/instrumentation/graal/native-image/build.gradle @@ -13,17 +13,19 @@ muzzle { apply from: "$rootDir/gradle/java.gradle" apply plugin: "idea" -[compileMain_java11Java, compileTestJava].each { - it.sourceCompatibility = JavaVersion.VERSION_11 - it.targetCompatibility = JavaVersion.VERSION_11 - setJavaVersion(it, 11) - it.options.compilerArgs.addAll([ - '-Xlint:all,-processing,-options,-path', - '--add-modules', - 'jdk.internal.vm.ci', - '--add-exports', - 'jdk.internal.vm.ci/jdk.vm.ci.meta=ALL-UNNAMED' - ]) +["compileMain_java11Java", "compileTestJava"].each { name -> + tasks.named(name, JavaCompile) { + it.sourceCompatibility = JavaVersion.VERSION_11 + it.targetCompatibility = JavaVersion.VERSION_11 + setJavaVersion(it, 11) + it.options.compilerArgs.addAll([ + '-Xlint:all,-processing,-options,-path', + '--add-modules', + 'jdk.internal.vm.ci', + '--add-exports', + 'jdk.internal.vm.ci/jdk.vm.ci.meta=ALL-UNNAMED' + ]) + } } dependencies { diff --git a/dd-java-agent/instrumentation/jakarta-rs-annotations-3/build.gradle b/dd-java-agent/instrumentation/jakarta-rs-annotations-3/build.gradle index 692894c79d0..33c07aa6e82 100644 --- a/dd-java-agent/instrumentation/jakarta-rs-annotations-3/build.gradle +++ b/dd-java-agent/instrumentation/jakarta-rs-annotations-3/build.gradle @@ -12,10 +12,10 @@ apply from: "$rootDir/gradle/java.gradle" addTestSuiteForDir('latestDepTest', 'test') addTestSuiteExtendingForDir('latestDepJava11Test', 'latestDepTest', 'test') -tasks.named("compileLatestDepJava11TestJava") { +tasks.named("compileLatestDepJava11TestJava", JavaCompile) { setJavaVersion(it, 11) } -tasks.named("compileLatestDepJava11TestGroovy") { +tasks.named("compileLatestDepJava11TestGroovy", GroovyCompile) { javaLauncher = getJavaLauncherFor(11) } tasks.named("latestDepJava11Test") { diff --git a/dd-java-agent/instrumentation/java-directbytebuffer/build.gradle b/dd-java-agent/instrumentation/java-directbytebuffer/build.gradle index 453c95e476c..6d3486bfd77 100644 --- a/dd-java-agent/instrumentation/java-directbytebuffer/build.gradle +++ b/dd-java-agent/instrumentation/java-directbytebuffer/build.gradle @@ -12,11 +12,13 @@ apply from: "$rootDir/gradle/java.gradle" apply plugin: "idea" // Must use Java 11 to build JFR enabled code - there is no JFR in OpenJDK 8 (revisit once JFR in Java 8 is available) -[compileMain_java11Java, compileTestJava].each { - it.sourceCompatibility = JavaVersion.VERSION_11 - it.targetCompatibility = JavaVersion.VERSION_11 - setJavaVersion(it, 11) - it.options.compilerArgs.addAll(['-Xlint:all,-processing,-options,-path']) +["compileMain_java11Java", "compileTestJava"].each { name -> + tasks.named(name, JavaCompile) { + it.sourceCompatibility = JavaVersion.VERSION_11 + it.targetCompatibility = JavaVersion.VERSION_11 + setJavaVersion(it, 11) + it.options.compilerArgs.addAll(['-Xlint:all,-processing,-options,-path']) + } } forbiddenApisMain_java11 { diff --git a/dd-java-agent/instrumentation/java-http-client/build.gradle b/dd-java-agent/instrumentation/java-http-client/build.gradle index 881c76e68c8..b015657103c 100644 --- a/dd-java-agent/instrumentation/java-http-client/build.gradle +++ b/dd-java-agent/instrumentation/java-http-client/build.gradle @@ -12,7 +12,7 @@ apply from: "$rootDir/gradle/java.gradle" apply plugin: "idea" -tasks.named("compileMain_java11Java") { +tasks.named("compileMain_java11Java", JavaCompile) { it.sourceCompatibility = JavaVersion.VERSION_11 it.targetCompatibility = JavaVersion.VERSION_11 setJavaVersion(it, 11) diff --git a/dd-java-agent/instrumentation/jdbc/scalikejdbc/build.gradle b/dd-java-agent/instrumentation/jdbc/scalikejdbc/build.gradle index 01258ed92f2..63f9a7db4dd 100644 --- a/dd-java-agent/instrumentation/jdbc/scalikejdbc/build.gradle +++ b/dd-java-agent/instrumentation/jdbc/scalikejdbc/build.gradle @@ -10,12 +10,12 @@ apply plugin: 'scala' addTestSuiteForDir('latestDepTest', 'test') -tasks.named("compileTestGroovy") { +tasks.named("compileTestGroovy", GroovyCompile) { dependsOn "compileTestScala" classpath += files(compileTestScala.destinationDirectory) } -tasks.named("compileLatestDepTestGroovy") { +tasks.named("compileLatestDepTestGroovy", GroovyCompile) { dependsOn "compileLatestDepTestScala" classpath += files(compileLatestDepTestScala.destinationDirectory) } diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-12.0/build.gradle b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-12.0/build.gradle index d2b57296201..f1db50816ec 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-12.0/build.gradle +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-12.0/build.gradle @@ -33,21 +33,24 @@ addTestSuiteExtendingForDir('ee10ForkedTest', 'ee10Test', 'test/ee10') addTestSuiteExtendingForDir('ee10LatestDepTest', 'latestDepTest', 'test/ee10') addTestSuiteExtendingForDir('ee10LatestDepForkedTest', 'ee10LatestDepTest', 'test/ee10') -[compileMain_java17Java, compileTestJava].each { - it.configure { +["compileMain_java17Java", "compileTestJava"].each { name -> + tasks.named(name, JavaCompile) { setJavaVersion(it, 17) sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } } -[ee8LatestDepTest, ee9LatestDepTest, ee10LatestDepTest].each { - it.configure { + +["ee8LatestDepTest", "ee9LatestDepTest", "ee10LatestDepTest"].each { name -> + tasks.named(name, Test) { it.jvmArgs += ['-Dtest.dd.latestDepTest=true'] } } + forbiddenApisMain_java17 { failOnMissingClasses = false } + tasks.withType(GroovyCompile).configureEach { javaLauncher = getJavaLauncherFor(17) } diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/build.gradle b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/build.gradle index 58505b89386..a4059f52e52 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/build.gradle +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/build.gradle @@ -105,7 +105,7 @@ instrument { ] } -tasks.named("compileMain_jetty10Java") { +tasks.named("compileMain_jetty10Java", JavaCompile) { setJavaVersion(it, 11) } @@ -117,7 +117,7 @@ addTestSuiteForDir('latestDepForkedTest', 'test') tasks.named("latestDepForkedTest") { javaLauncher = getJavaLauncherFor(11) } -tasks.named("compileLatestDepForkedTestGroovy") { +tasks.named("compileLatestDepForkedTestGroovy", GroovyCompile) { setJavaVersion(it, 11) } diff --git a/dd-java-agent/instrumentation/junit/junit-4.10/build.gradle b/dd-java-agent/instrumentation/junit/junit-4.10/build.gradle index 8e9fc779083..53ca08ce9d4 100644 --- a/dd-java-agent/instrumentation/junit/junit-4.10/build.gradle +++ b/dd-java-agent/instrumentation/junit/junit-4.10/build.gradle @@ -12,7 +12,7 @@ muzzle { addTestSuiteForDir('latestDepTest', 'test') -tasks.named("compileLatestDepTestGroovy") { +tasks.named("compileLatestDepTestGroovy", GroovyCompile) { classpath += files(compileLatestDepTestKotlin.destinationDirectory) } diff --git a/dd-java-agent/instrumentation/junit/junit-5.3/build.gradle b/dd-java-agent/instrumentation/junit/junit-5.3/build.gradle index d4315f94839..7bcad011e0d 100644 --- a/dd-java-agent/instrumentation/junit/junit-5.3/build.gradle +++ b/dd-java-agent/instrumentation/junit/junit-5.3/build.gradle @@ -58,7 +58,7 @@ configurations.matching({ it.name.startsWith('test') }).each({ } }) -tasks.named("compileLatestDepTestJava") { +tasks.named("compileLatestDepTestJava", JavaCompile) { setJavaVersion(it, 17) sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 diff --git a/dd-java-agent/instrumentation/junit/junit-5.3/junit-5.8/build.gradle b/dd-java-agent/instrumentation/junit/junit-5.3/junit-5.8/build.gradle index 399cfd48c4a..504dd83d6ad 100644 --- a/dd-java-agent/instrumentation/junit/junit-5.3/junit-5.8/build.gradle +++ b/dd-java-agent/instrumentation/junit/junit-5.3/junit-5.8/build.gradle @@ -57,7 +57,7 @@ configurations.matching({ it.name.startsWith('test') }).each({ } }) -tasks.named("compileLatestDepTestJava") { +tasks.named("compileLatestDepTestJava", JavaCompile) { setJavaVersion(it, 17) sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 diff --git a/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/build.gradle b/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/build.gradle index dc1a75ddf7a..c38f72a9e96 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/build.gradle +++ b/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/build.gradle @@ -16,13 +16,14 @@ apply from: "$rootDir/gradle/java.gradle" addTestSuiteForDir('latestDepTest', 'test') addTestSuiteExtendingForDir('latestDepForkedTest', 'latestDepTest', 'test') -[compileMain_java17Java, compileTestJava, compileLatestDepTestJava].each { - it.configure { +["compileMain_java17Java", "compileTestJava", "compileLatestDepTestJava"].each { name -> + tasks.named(name, JavaCompile) { setJavaVersion(it, 17) sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } } + tasks.withType(JavaCompile).each { it.configure { setJavaVersion(it, 17) @@ -30,6 +31,7 @@ tasks.withType(JavaCompile).each { targetCompatibility = JavaVersion.VERSION_1_8 } } + tasks.withType(GroovyCompile) { javaLauncher = getJavaLauncherFor(17) } diff --git a/dd-java-agent/instrumentation/karate/build.gradle b/dd-java-agent/instrumentation/karate/build.gradle index 085aa516f7e..0208b8ac463 100644 --- a/dd-java-agent/instrumentation/karate/build.gradle +++ b/dd-java-agent/instrumentation/karate/build.gradle @@ -81,7 +81,7 @@ sourceSets { } } -tasks.named("compileLatestDepTestJava") { +tasks.named("compileLatestDepTestJava", JavaCompile) { setJavaVersion(it, 11) sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 diff --git a/dd-java-agent/instrumentation/kotlin-coroutines/build.gradle b/dd-java-agent/instrumentation/kotlin-coroutines/build.gradle index f68ac87ad53..678b0fd9caa 100644 --- a/dd-java-agent/instrumentation/kotlin-coroutines/build.gradle +++ b/dd-java-agent/instrumentation/kotlin-coroutines/build.gradle @@ -26,15 +26,15 @@ apply from: "$rootDir/gradle/test-with-kotlin.gradle" addTestSuite('latestDepTest') -tasks.named("compileTestFixturesGroovy") { +tasks.named("compileTestFixturesGroovy", GroovyCompile) { classpath += files(compileTestFixturesKotlin.destinationDirectory) } -tasks.named("compileTestGroovy") { +tasks.named("compileTestGroovy", GroovyCompile) { classpath += files(compileTestKotlin.destinationDirectory) } -tasks.named("compileLatestDepTestGroovy") { +tasks.named("compileLatestDepTestGroovy", GroovyCompile) { classpath += files(compileLatestDepTestKotlin.destinationDirectory) } diff --git a/dd-java-agent/instrumentation/micronaut/http-server-netty-4.0/build.gradle b/dd-java-agent/instrumentation/micronaut/http-server-netty-4.0/build.gradle index d2b5035c01c..0c6ca40b35e 100644 --- a/dd-java-agent/instrumentation/micronaut/http-server-netty-4.0/build.gradle +++ b/dd-java-agent/instrumentation/micronaut/http-server-netty-4.0/build.gradle @@ -14,16 +14,16 @@ apply from: "$rootDir/gradle/java.gradle" addTestSuiteForDir('latestDepTest', 'test') -[compileMain_java17Java, compileTestJava, compileLatestDepTestJava].each { - it.configure { +["compileMain_java17Java", "compileTestJava", "compileLatestDepTestJava"].each { name -> + tasks.named(name, JavaCompile) { setJavaVersion(it, 17) sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } } -[compileTestGroovy, compileLatestDepTestGroovy].each { - it.configure { +["compileTestGroovy", "compileLatestDepTestGroovy"].each { name -> + tasks.named(name, GroovyCompile) { javaLauncher = getJavaLauncherFor(17) } } diff --git a/dd-java-agent/instrumentation/mule-4.5/build.gradle b/dd-java-agent/instrumentation/mule-4.5/build.gradle index 7612c1c9a40..6d79026bae5 100644 --- a/dd-java-agent/instrumentation/mule-4.5/build.gradle +++ b/dd-java-agent/instrumentation/mule-4.5/build.gradle @@ -114,20 +114,20 @@ forbiddenApisMain_java11 { failOnMissingClasses = false } -tasks.named("compileTestGroovy") { +tasks.named("compileTestGroovy", GroovyCompile) { dependsOn 'mvnPackage', 'extractMuleServices' } -tasks.named("compileMule46ForkedTestGroovy") { +tasks.named("compileMule46ForkedTestGroovy", GroovyCompile) { dependsOn 'mvnPackage', 'extractMule46Services' } -tasks.named("compileLatestDepForkedTestGroovy") { +tasks.named("compileLatestDepForkedTestGroovy", GroovyCompile) { dependsOn 'mvnPackage', 'extractLatestMuleServices' setJavaVersion(it, 17) } -tasks.named("compileLatestDepForkedTestJava") { +tasks.named("compileLatestDepForkedTestJava", JavaCompile) { setJavaVersion(it, 17) } diff --git a/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/build.gradle b/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/build.gradle index 0fa5c2e2ae7..f0d24b7e7a6 100644 --- a/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/build.gradle +++ b/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/build.gradle @@ -23,7 +23,7 @@ apply from: "$rootDir/gradle/test-with-scala.gradle" addTestSuiteForDir('latestDepTest', 'test') -tasks.named("compileLatestDepTestGroovy") { +tasks.named("compileLatestDepTestGroovy", GroovyCompile) { classpath += files(sourceSets.latestDepTest.scala.classesDirectory) } diff --git a/dd-java-agent/instrumentation/play/play-2.6/build.gradle b/dd-java-agent/instrumentation/play/play-2.6/build.gradle index a38297784bd..f23a821bd5b 100644 --- a/dd-java-agent/instrumentation/play/play-2.6/build.gradle +++ b/dd-java-agent/instrumentation/play/play-2.6/build.gradle @@ -126,7 +126,7 @@ configurations.matching({ it.name.startsWith('latestDepTest') }).each({ force group: 'ch.qos.logback', name: 'logback-classic', version: '1.4.5' } }) -tasks.named("compileLatestDepTestJava") { +tasks.named("compileLatestDepTestJava", JavaCompile) { it.sourceCompatibility = JavaVersion.VERSION_11 it.targetCompatibility = JavaVersion.VERSION_11 setJavaVersion(it, 11) diff --git a/dd-java-agent/instrumentation/scala-concurrent/build.gradle b/dd-java-agent/instrumentation/scala-concurrent/build.gradle index a5ebd5968c0..41ba30358ad 100644 --- a/dd-java-agent/instrumentation/scala-concurrent/build.gradle +++ b/dd-java-agent/instrumentation/scala-concurrent/build.gradle @@ -19,16 +19,16 @@ addTestSuite('latestDepTest') addTestSuiteForDir('latest12Test', 'latestDepTest') addTestSuiteForDir('latest11Test', 'test') -tasks.named("compileTestGroovy") { +tasks.named("compileTestGroovy", GroovyCompile) { classpath += files(sourceSets.test.scala.classesDirectory) } -tasks.named("compileLatest12TestGroovy") { +tasks.named("compileLatest12TestGroovy", GroovyCompile) { classpath += files(sourceSets.latest12Test.scala.classesDirectory) } -tasks.named("compileLatest11TestGroovy") { +tasks.named("compileLatest11TestGroovy", GroovyCompile) { classpath += files(sourceSets.latest11Test.scala.classesDirectory) } -tasks.named("compileLatestDepTestGroovy") { +tasks.named("compileLatestDepTestGroovy", GroovyCompile) { classpath += files(sourceSets.latestDepTest.scala.classesDirectory) } diff --git a/dd-java-agent/instrumentation/scala-promise/build.gradle b/dd-java-agent/instrumentation/scala-promise/build.gradle index 25fa5520996..b87e40df348 100644 --- a/dd-java-agent/instrumentation/scala-promise/build.gradle +++ b/dd-java-agent/instrumentation/scala-promise/build.gradle @@ -13,7 +13,7 @@ muzzle { apply from: "$rootDir/gradle/java.gradle" apply plugin: 'scala' -tasks.named("compileTestGroovy") { +tasks.named("compileTestGroovy", GroovyCompile) { classpath += files(sourceSets.test.scala.classesDirectory) } diff --git a/dd-java-agent/instrumentation/scala-promise/scala-promise-2.10/build.gradle b/dd-java-agent/instrumentation/scala-promise/scala-promise-2.10/build.gradle index baa9b68315a..c51e24e8906 100644 --- a/dd-java-agent/instrumentation/scala-promise/scala-promise-2.10/build.gradle +++ b/dd-java-agent/instrumentation/scala-promise/scala-promise-2.10/build.gradle @@ -45,17 +45,17 @@ sourceSets { latestDepForkedTest.scala.srcDir project(':dd-java-agent:instrumentation:scala-promise').sourceSets.test.scala } -tasks.named("compileTestGroovy") { +tasks.named("compileTestGroovy", GroovyCompile) { classpath += files(sourceSets.test.scala.classesDirectory) dependsOn "compileTestScala" } -tasks.named("compileLatestDepTestGroovy") { +tasks.named("compileLatestDepTestGroovy", GroovyCompile) { classpath += files(sourceSets.latestDepTest.scala.classesDirectory) dependsOn "compileLatestDepTestScala" } -tasks.named("compileLatestDepForkedTestGroovy") { +tasks.named("compileLatestDepForkedTestGroovy", GroovyCompile) { classpath += files(sourceSets.latestDepForkedTest.scala.classesDirectory) dependsOn "compileLatestDepForkedTestScala" } diff --git a/dd-java-agent/instrumentation/scala-promise/scala-promise-2.13/build.gradle b/dd-java-agent/instrumentation/scala-promise/scala-promise-2.13/build.gradle index 59b062db1f8..9f2a440c242 100644 --- a/dd-java-agent/instrumentation/scala-promise/scala-promise-2.13/build.gradle +++ b/dd-java-agent/instrumentation/scala-promise/scala-promise-2.13/build.gradle @@ -45,15 +45,15 @@ sourceSets { latestDepForkedTest.scala.srcDir project(':dd-java-agent:instrumentation:scala-promise').sourceSets.test.scala } -tasks.named("compileTestGroovy") { +tasks.named("compileTestGroovy", GroovyCompile) { classpath += files(sourceSets.test.scala.classesDirectory) } -tasks.named("compileLatestDepTestGroovy") { +tasks.named("compileLatestDepTestGroovy", GroovyCompile) { classpath += files(sourceSets.latestDepTest.scala.classesDirectory) } -tasks.named("compileLatestDepForkedTestGroovy") { +tasks.named("compileLatestDepForkedTestGroovy", GroovyCompile) { classpath += files(sourceSets.latestDepForkedTest.scala.classesDirectory) } diff --git a/dd-java-agent/instrumentation/selenium/build.gradle b/dd-java-agent/instrumentation/selenium/build.gradle index 0b4a6f6537b..d4ac58956b9 100644 --- a/dd-java-agent/instrumentation/selenium/build.gradle +++ b/dd-java-agent/instrumentation/selenium/build.gradle @@ -42,7 +42,7 @@ configurations.matching({ it.name.startsWith('test') || it.name.startsWith('late } }) -tasks.named("compileLatestDepTestJava") { +tasks.named("compileLatestDepTestJava", JavaCompile) { setJavaVersion(it, 11) sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 diff --git a/dd-java-agent/instrumentation/slick/build.gradle b/dd-java-agent/instrumentation/slick/build.gradle index 37171291dea..a0ba86d95d2 100644 --- a/dd-java-agent/instrumentation/slick/build.gradle +++ b/dd-java-agent/instrumentation/slick/build.gradle @@ -10,12 +10,12 @@ apply plugin: 'scala' addTestSuiteForDir('latestDepTest', 'test') -tasks.named("compileTestGroovy") { +tasks.named("compileTestGroovy", GroovyCompile) { dependsOn "compileTestScala" classpath += files(compileTestScala.destinationDirectory) } -tasks.named("compileLatestDepTestGroovy") { +tasks.named("compileLatestDepTestGroovy", GroovyCompile) { dependsOn "compileLatestDepTestScala" classpath += files(compileLatestDepTestScala.destinationDirectory) } diff --git a/dd-java-agent/instrumentation/spring/spring-boot-1.3/build.gradle b/dd-java-agent/instrumentation/spring/spring-boot-1.3/build.gradle index b6665d2e314..fba6eb65f8b 100644 --- a/dd-java-agent/instrumentation/spring/spring-boot-1.3/build.gradle +++ b/dd-java-agent/instrumentation/spring/spring-boot-1.3/build.gradle @@ -31,8 +31,10 @@ addTestSuiteExtendingForDir("boot2LatestDepForkedTest", "boot2LatestDepTest", "t addTestSuiteExtendingForDir("boot3ForkedTest", "boot3Test", "test") addTestSuiteExtendingForDir("latestDepForkedTest", "latestDepTest", "test") -[compileLatestDepTestGroovy, compileBoot3TestGroovy].each { - it.javaLauncher = getJavaLauncherFor(17) +["compileLatestDepTestGroovy", "compileBoot3TestGroovy"].each { name -> + tasks.named(name, GroovyCompile) { + javaLauncher = getJavaLauncherFor(17) + } } dependencies { diff --git a/dd-java-agent/instrumentation/spring/spring-messaging-4.0/build.gradle b/dd-java-agent/instrumentation/spring/spring-messaging-4.0/build.gradle index 9df4b5a091e..d0ef3d36d47 100644 --- a/dd-java-agent/instrumentation/spring/spring-messaging-4.0/build.gradle +++ b/dd-java-agent/instrumentation/spring/spring-messaging-4.0/build.gradle @@ -16,8 +16,10 @@ apply from: "$rootDir/gradle/java.gradle" addTestSuiteForDir('latestDepTest', 'test') -[compileTestGroovy, compileLatestDepTestGroovy].each { - it.javaLauncher = getJavaLauncherFor(17) +["compileTestGroovy", "compileLatestDepTestGroovy"].each { name -> + tasks.named(name, GroovyCompile) { + javaLauncher = getJavaLauncherFor(17) + } } dependencies { diff --git a/dd-java-agent/instrumentation/spring/spring-scheduling-3.1/build.gradle b/dd-java-agent/instrumentation/spring/spring-scheduling-3.1/build.gradle index ec67b53ab3a..8fa56d7ac05 100644 --- a/dd-java-agent/instrumentation/spring/spring-scheduling-3.1/build.gradle +++ b/dd-java-agent/instrumentation/spring/spring-scheduling-3.1/build.gradle @@ -27,26 +27,30 @@ addTestSuiteExtendingForDir('latestDepForkedTest','latestDepTest', 'latestDepTes addTestSuiteForDir('spring6Test', 'test') addTestSuiteForDir('latestSpring5Test', 'test') -[compileSpring6TestJava, compileLatestDepTestJava, compileLatestDepForkedTestJava].each { - setJavaVersion(it, 17) - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 +["compileSpring6TestJava", "compileLatestDepTestJava", "compileLatestDepForkedTestJava"].each { name -> + tasks.named(name, JavaCompile) { + setJavaVersion(it, 17) + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } } +["compileSpring6TestGroovy", "compileLatestDepTestGroovy", "compileLatestDepForkedTestGroovy"].each { name -> + tasks.named(name, GroovyCompile) { + javaLauncher = getJavaLauncherFor(17) + } +} -[ - compileSpring6TestGroovy, - compileLatestDepTestGroovy, - compileLatestDepForkedTestGroovy, - spring6Test, - latestDepTest, - latestDepForkedTest -].each { - it.javaLauncher = getJavaLauncherFor(17) +["spring6Test", "latestDepTest", "latestDepForkedTest"].each { name -> + tasks.named(name, Test) { + javaLauncher = getJavaLauncherFor(17) + } } -[spring6Test, latestDepTest, latestDepForkedTest].each { - it.jvmArgs '--add-opens', 'java.base/java.util=ALL-UNNAMED' +["spring6Test", "latestDepTest", "latestDepForkedTest"].each { name -> + tasks.named(name, Test) { + jvmArgs '--add-opens', 'java.base/java.util=ALL-UNNAMED' + } } dependencies { diff --git a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/build.gradle b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/build.gradle index 4baac9ce55a..a4838c2d48d 100644 --- a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/build.gradle +++ b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/build.gradle @@ -16,8 +16,8 @@ apply from: "$rootDir/gradle/java.gradle" addTestSuiteForDir("latestDepTest", "test") -[compileMain_java17Java, compileTestJava, compileLatestDepTestJava].each { - it.configure { +["compileMain_java17Java", "compileTestJava", "compileLatestDepTestJava"].each { name -> + tasks.named(name, JavaCompile) { setJavaVersion(it, 17) sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 diff --git a/dd-java-agent/instrumentation/tomcat/tomcat-5.5/build.gradle b/dd-java-agent/instrumentation/tomcat/tomcat-5.5/build.gradle index 594c05cfb57..42d0b3e7e65 100644 --- a/dd-java-agent/instrumentation/tomcat/tomcat-5.5/build.gradle +++ b/dd-java-agent/instrumentation/tomcat/tomcat-5.5/build.gradle @@ -72,12 +72,16 @@ configurations.configureEach { } } -[compileLatest10TestGroovy, compileLatest10ForkedTestGroovy].each { - it.javaLauncher = getJavaLauncherFor(11) +["compileLatest10TestGroovy", "compileLatest10ForkedTestGroovy"].each { name -> + tasks.named(name, GroovyCompile) { + javaLauncher = getJavaLauncherFor(11) + } } -[compileLatestDepTestGroovy, compileLatestDepForkedTestGroovy].each { - it.javaLauncher = getJavaLauncherFor(17) +["compileLatestDepTestGroovy", "compileLatestDepForkedTestGroovy"].each { name -> + tasks.named(name, GroovyCompile) { + javaLauncher = getJavaLauncherFor(17) + } } dependencies { diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/build.gradle b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/build.gradle index f5d9ca878a3..5accdc9d92b 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/build.gradle +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/build.gradle @@ -58,9 +58,14 @@ dependencies { latestDepTestImplementation group: 'io.vertx', name: 'vertx-web-client', version: '4.+' } -[compileLatestDepTestJava, compileLatestDepForkedTestJava].each { - setJavaVersion(it, 11) +["compileLatestDepTestJava", "compileLatestDepForkedTestJava"].each { name -> + tasks.named(name, JavaCompile) { + setJavaVersion(it, 11) + } } -[compileLatestDepForkedTestGroovy, compileLatestDepTestGroovy].each { - it.javaLauncher = getJavaLauncherFor(11) + +["compileLatestDepForkedTestGroovy", "compileLatestDepTestGroovy"].each { name -> + tasks.named(name, GroovyCompile) { + javaLauncher = getJavaLauncherFor(11) + } } diff --git a/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-10/build.gradle b/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-10/build.gradle index 1b4488d5b3e..85344b23542 100644 --- a/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-10/build.gradle +++ b/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-10/build.gradle @@ -17,13 +17,16 @@ apply from: "$rootDir/gradle/java.gradle" addTestSuite("latestDepTest") -compileMain_java11Java.configure { +tasks.named("compileMain_java11Java", JavaCompile) { setJavaVersion(it, 11) sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } -[compileTestGroovy, compileLatestDepTestGroovy].each { - it.javaLauncher = getJavaLauncherFor(11) + +["compileTestGroovy", "compileLatestDepTestGroovy"].each { name -> + tasks.named(name, GroovyCompile) { + javaLauncher = getJavaLauncherFor(11) + } } dependencies { diff --git a/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-11/build.gradle b/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-11/build.gradle index e1b6775832d..a1fbd11bb79 100644 --- a/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-11/build.gradle +++ b/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-11/build.gradle @@ -17,8 +17,10 @@ apply from: "$rootDir/gradle/java.gradle" addTestSuite("latestDepTest") -[compileTestGroovy, compileLatestDepTestGroovy].each { - it.javaLauncher = getJavaLauncherFor(11) +["compileTestGroovy", "compileLatestDepTestGroovy"].each { name -> + tasks.named(name, GroovyCompile) { + javaLauncher = getJavaLauncherFor(11) + } } dependencies { diff --git a/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-12/build.gradle b/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-12/build.gradle index 248b14e4549..7ae85334ed4 100644 --- a/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-12/build.gradle +++ b/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-12/build.gradle @@ -30,8 +30,10 @@ apply from: "$rootDir/gradle/java.gradle" addTestSuiteForDir("latestDepTest", "test") -[compileTestGroovy, compileLatestDepTestGroovy].each { - it.javaLauncher = getJavaLauncherFor(17) +["compileTestGroovy", "compileLatestDepTestGroovy"].each { name -> + tasks.named(name, GroovyCompile) { + javaLauncher = getJavaLauncherFor(17) + } } dependencies { diff --git a/dd-java-agent/instrumentation/wildfly-9.0/build.gradle b/dd-java-agent/instrumentation/wildfly-9.0/build.gradle index eb3149d2397..beb327ff2b3 100644 --- a/dd-java-agent/instrumentation/wildfly-9.0/build.gradle +++ b/dd-java-agent/instrumentation/wildfly-9.0/build.gradle @@ -119,26 +119,24 @@ tasks.named("latestDepTest") { dependsOn 'extractLatestWildfly' } -compileTestGroovy.configure { +tasks.named("compileTestGroovy", GroovyCompile) { javaLauncher = getJavaLauncherFor(11) } -[compileLatestDepTestGroovy, compileLatestDepForkedTestGroovy].each { - it.configure { +["compileLatestDepTestGroovy", "compileLatestDepForkedTestGroovy"].each { name -> + tasks.named(name, GroovyCompile) { javaLauncher = getJavaLauncherFor(17) } } -compileTestJava.configure { - it.configure { - setJavaVersion(it, 11) - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } +tasks.named("compileTestJava", JavaCompile) { + setJavaVersion(it, 11) + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } -[compileLatestDepTestJava, compileLatestDepForkedTestJava].each { - it.configure { +["compileLatestDepTestJava", "compileLatestDepForkedTestJava"].each { name -> + tasks.named(name, JavaCompile) { setJavaVersion(it, 17) sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 diff --git a/dd-java-agent/instrumentation/zio/zio-2.0/build.gradle b/dd-java-agent/instrumentation/zio/zio-2.0/build.gradle index c4e1b6f3f5e..ef88d10dbd7 100644 --- a/dd-java-agent/instrumentation/zio/zio-2.0/build.gradle +++ b/dd-java-agent/instrumentation/zio/zio-2.0/build.gradle @@ -29,7 +29,8 @@ apply from: "$rootDir/gradle/java.gradle" apply from: "$rootDir/gradle/test-with-scala.gradle" addTestSuiteForDir('latestDepTest', 'test') -tasks.named("compileLatestDepTestGroovy") { + +tasks.named("compileLatestDepTestGroovy", GroovyCompile) { dependsOn "compileLatestDepTestScala" classpath += files(compileLatestDepTestScala.destinationDirectory) } diff --git a/dd-smoke-tests/armeria-grpc/build.gradle b/dd-smoke-tests/armeria-grpc/build.gradle index 3e49a23b935..fc5977dedcf 100644 --- a/dd-smoke-tests/armeria-grpc/build.gradle +++ b/dd-smoke-tests/armeria-grpc/build.gradle @@ -79,7 +79,7 @@ armeriaBuild { dependsOn project(':dd-trace-api').tasks.named("jar") } -tasks.named("compileTestGroovy") { +tasks.named("compileTestGroovy", GroovyCompile) { dependsOn 'armeriaBuild' outputs.upToDateWhen { !armeriaBuild.didWork diff --git a/dd-smoke-tests/play-2.4/build.gradle b/dd-smoke-tests/play-2.4/build.gradle index 74817b3824e..8855c70db42 100644 --- a/dd-smoke-tests/play-2.4/build.gradle +++ b/dd-smoke-tests/play-2.4/build.gradle @@ -72,7 +72,7 @@ configurations.testImplementation { exclude group:'com.typesafe.play', module:"play-test_$scalaVer" } -tasks.named("compileTestGroovy") { +tasks.named("compileTestGroovy", GroovyCompile) { dependsOn 'stageMainDist' outputs.upToDateWhen { !stageMainDist.didWork diff --git a/dd-smoke-tests/play-2.5/build.gradle b/dd-smoke-tests/play-2.5/build.gradle index 0ac6814028d..405bb322abd 100644 --- a/dd-smoke-tests/play-2.5/build.gradle +++ b/dd-smoke-tests/play-2.5/build.gradle @@ -74,7 +74,7 @@ configurations.testImplementation { exclude group:'com.typesafe.play', module:"play-test_$scalaVer" } -tasks.named("compileTestGroovy") { +tasks.named("compileTestGroovy", GroovyCompile) { dependsOn 'stageMainDist' outputs.upToDateWhen { !stageMainDist.didWork diff --git a/dd-smoke-tests/quarkus/build.gradle b/dd-smoke-tests/quarkus/build.gradle index 1c5a095ba13..45246cae823 100644 --- a/dd-smoke-tests/quarkus/build.gradle +++ b/dd-smoke-tests/quarkus/build.gradle @@ -39,7 +39,7 @@ tasks.named("quarkusBuild", Exec) { dependsOn project(':dd-trace-api').tasks.named("jar") } -tasks.named("compileTestGroovy") { +tasks.named("compileTestGroovy", GroovyCompile) { dependsOn 'quarkusBuild' outputs.upToDateWhen { !quarkusBuild.didWork diff --git a/dd-smoke-tests/rum/wildfly-15/build.gradle b/dd-smoke-tests/rum/wildfly-15/build.gradle index b6c11656ae2..12e6cdabb18 100644 --- a/dd-smoke-tests/rum/wildfly-15/build.gradle +++ b/dd-smoke-tests/rum/wildfly-15/build.gradle @@ -67,7 +67,7 @@ tasks.named("earBuild", Exec) { dependsOn project(':dd-trace-api').tasks.named("jar") } -tasks.named("compileTestGroovy") { +tasks.named("compileTestGroovy", GroovyCompile) { dependsOn tasks.earBuild outputs.upToDateWhen { !earBuild.didWork diff --git a/dd-smoke-tests/spring-boot-2.7-webflux/build.gradle b/dd-smoke-tests/spring-boot-2.7-webflux/build.gradle index 19be6a8e255..805fa0efb55 100644 --- a/dd-smoke-tests/spring-boot-2.7-webflux/build.gradle +++ b/dd-smoke-tests/spring-boot-2.7-webflux/build.gradle @@ -34,7 +34,7 @@ tasks.named("webfluxBuild", Exec) { dependsOn project(':dd-trace-api').tasks.named("jar") } -tasks.named("compileTestGroovy") { +tasks.named("compileTestGroovy", GroovyCompile) { dependsOn 'webfluxBuild' outputs.upToDateWhen { !webfluxBuild.didWork diff --git a/dd-smoke-tests/spring-boot-3.0-webflux/build.gradle b/dd-smoke-tests/spring-boot-3.0-webflux/build.gradle index ce9376e098b..bff4bc11a41 100644 --- a/dd-smoke-tests/spring-boot-3.0-webflux/build.gradle +++ b/dd-smoke-tests/spring-boot-3.0-webflux/build.gradle @@ -39,7 +39,7 @@ tasks.named("webfluxBuild30", Exec) { dependsOn project(':dd-trace-api').tasks.named("jar") } -tasks.named("compileTestGroovy") { +tasks.named("compileTestGroovy", GroovyCompile) { dependsOn 'webfluxBuild30' outputs.upToDateWhen { !webfluxBuild30.didWork diff --git a/dd-smoke-tests/springboot-openliberty-20/build.gradle b/dd-smoke-tests/springboot-openliberty-20/build.gradle index 01b95f1dc50..e642d5426a0 100644 --- a/dd-smoke-tests/springboot-openliberty-20/build.gradle +++ b/dd-smoke-tests/springboot-openliberty-20/build.gradle @@ -21,7 +21,7 @@ tasks.register('mvnStage', Exec) { outputs.file jarPath } -tasks.named("compileTestGroovy") { +tasks.named("compileTestGroovy", GroovyCompile) { dependsOn 'mvnStage' outputs.upToDateWhen { !mvnStage.didWork diff --git a/dd-smoke-tests/springboot-openliberty-23/build.gradle b/dd-smoke-tests/springboot-openliberty-23/build.gradle index 4e9db404fcf..833706a15f8 100644 --- a/dd-smoke-tests/springboot-openliberty-23/build.gradle +++ b/dd-smoke-tests/springboot-openliberty-23/build.gradle @@ -20,7 +20,7 @@ tasks.register('mvnStage', Exec) { outputs.file jarPath } -tasks.named("compileTestGroovy") { +tasks.named("compileTestGroovy", GroovyCompile) { dependsOn 'mvnStage' outputs.upToDateWhen { !mvnStage.didWork diff --git a/dd-smoke-tests/vertx-3.4/build.gradle b/dd-smoke-tests/vertx-3.4/build.gradle index 04a5bb7cc1a..af8fef64106 100644 --- a/dd-smoke-tests/vertx-3.4/build.gradle +++ b/dd-smoke-tests/vertx-3.4/build.gradle @@ -38,7 +38,7 @@ tasks.named("vertxBuild", Exec) { dependsOn project(':dd-trace-api').tasks.named("jar") } -tasks.named("compileTestGroovy") { +tasks.named("compileTestGroovy", GroovyCompile) { dependsOn 'vertxBuild' outputs.upToDateWhen { !vertxBuild.didWork diff --git a/dd-smoke-tests/vertx-3.9-resteasy/build.gradle b/dd-smoke-tests/vertx-3.9-resteasy/build.gradle index 7657efc546a..0cd913e25dd 100644 --- a/dd-smoke-tests/vertx-3.9-resteasy/build.gradle +++ b/dd-smoke-tests/vertx-3.9-resteasy/build.gradle @@ -35,7 +35,7 @@ tasks.named("vertxBuild", Exec) { dependsOn project(':dd-trace-api').tasks.named("jar") } -tasks.named("compileTestGroovy") { +tasks.named("compileTestGroovy", GroovyCompile) { dependsOn 'vertxBuild' outputs.upToDateWhen { !vertxBuild.didWork diff --git a/dd-smoke-tests/vertx-3.9/build.gradle b/dd-smoke-tests/vertx-3.9/build.gradle index eec920f0646..c34032cec4f 100644 --- a/dd-smoke-tests/vertx-3.9/build.gradle +++ b/dd-smoke-tests/vertx-3.9/build.gradle @@ -36,7 +36,7 @@ tasks.named("vertxBuild", Exec) { dependsOn project(':dd-trace-api').tasks.named("jar") } -tasks.named("compileTestGroovy") { +tasks.named("compileTestGroovy", GroovyCompile) { dependsOn 'vertxBuild' outputs.upToDateWhen { !vertxBuild.didWork diff --git a/dd-smoke-tests/vertx-4.2/build.gradle b/dd-smoke-tests/vertx-4.2/build.gradle index 0248e73e72e..15a1556fc47 100644 --- a/dd-smoke-tests/vertx-4.2/build.gradle +++ b/dd-smoke-tests/vertx-4.2/build.gradle @@ -37,7 +37,7 @@ tasks.named("vertxBuild", Exec) { dependsOn project(':dd-trace-api').tasks.named("jar") } -tasks.named("compileTestGroovy") { +tasks.named("compileTestGroovy", GroovyCompile) { dependsOn 'vertxBuild' outputs.upToDateWhen { !vertxBuild.didWork diff --git a/dd-smoke-tests/wildfly/build.gradle b/dd-smoke-tests/wildfly/build.gradle index ca84acb05d1..a0995e1e08d 100644 --- a/dd-smoke-tests/wildfly/build.gradle +++ b/dd-smoke-tests/wildfly/build.gradle @@ -67,7 +67,7 @@ tasks.named("earBuild", Exec) { dependsOn project(':dd-trace-api').tasks.named("jar") } -tasks.named("compileTestGroovy") { +tasks.named("compileTestGroovy", GroovyCompile) { dependsOn tasks.earBuild outputs.upToDateWhen { !earBuild.didWork diff --git a/gradle/test-with-kotlin.gradle b/gradle/test-with-kotlin.gradle index b124878c1aa..133a9bd46a3 100644 --- a/gradle/test-with-kotlin.gradle +++ b/gradle/test-with-kotlin.gradle @@ -2,7 +2,7 @@ apply plugin: 'kotlin' apply from: "$rootDir/gradle/spotless/spotless-kotlin.gradle" -tasks.named("compileTestGroovy") { +tasks.named("compileTestGroovy", GroovyCompile) { //Note: look like it should be `classpath += files(sourceSets.test.kotlin.classesDirectory)` //instead, but kotlin plugin doesn't support it (yet?) classpath += files(compileTestKotlin.destinationDirectory) diff --git a/gradle/test-with-scala.gradle b/gradle/test-with-scala.gradle index d25891cc7d8..2f43bbcc0f2 100644 --- a/gradle/test-with-scala.gradle +++ b/gradle/test-with-scala.gradle @@ -7,6 +7,6 @@ dependencies { testImplementation libs.scala } -tasks.named("compileTestGroovy") { +tasks.named("compileTestGroovy", GroovyCompile) { classpath += files(sourceSets.test.scala.classesDirectory) }