Migrate scala to convention plugin.
ADD
buildSrc/src/main/kotlin/otel.scala-conventions.gradle.kts
+// Enable testing scala code in groovy spock tests.
+
+plugins {
+ scala
+}
+
+dependencies {
+ testImplementation("org.scala-lang:scala-library")
+}
+
+tasks {
+ named<GroovyCompile>("compileTestGroovy") {
+ sourceSets.test {
+ withConvention(ScalaSourceSet::class) {
+ classpath = classpath.plus(files(scala.classesDirectory))
+ }
+ }
+ }
+}

DELETE
gradle/test-with-scala.gradle
-// Enable testing scala code in groovy spock tests.
-
-apply plugin: 'scala'
-
-dependencies {
- testImplementation "org.scala-lang:scala-library"
-}
-
-tasks.named('compileTestGroovy').configure {
- classpath += files(sourceSets.test.scala.classesDirectory)
-}

MODIFY
instrumentation/akka-actor-2.5/javaagent/akka-actor-2.5-javaagent.gradle
instrumentation/akka-actor-2.5/javaagent/akka-actor-2.5-javaagent.gradle
apply from: "$rootDir/gradle/instrumentation.gradle"
-apply from: "$rootDir/gradle/test-with-scala.gradle"
+apply plugin: "otel.scala-conventions"
muzzle {
pass {

MODIFY
instrumentation/akka-actor-fork-join-2.5/javaagent/akka-actor-fork-join-2.5-javaagent.gradle
instrumentation/akka-actor-fork-join-2.5/javaagent/akka-actor-fork-join-2.5-javaagent.gradle
apply from: "$rootDir/gradle/instrumentation.gradle"
-apply from: "$rootDir/gradle/test-with-scala.gradle"
+apply plugin: "otel.scala-conventions"
muzzle {
pass {

MODIFY
instrumentation/akka-http-10.0/javaagent/akka-http-10.0-javaagent.gradle
instrumentation/akka-http-10.0/javaagent/akka-http-10.0-javaagent.gradle
apply from: "$rootDir/gradle/instrumentation.gradle"
-apply from: "$rootDir/gradle/test-with-scala.gradle"
+apply plugin: "otel.scala-conventions"
muzzle {
pass {

MODIFY
instrumentation/finatra-2.9/javaagent/finatra-2.9-javaagent.gradle
instrumentation/finatra-2.9/javaagent/finatra-2.9-javaagent.gradle
apply from: "$rootDir/gradle/instrumentation.gradle"
-apply from: "$rootDir/gradle/test-with-scala.gradle"
+apply plugin: "otel.scala-conventions"
apply plugin: 'org.unbroken-dome.test-sets'

MODIFY
instrumentation/scala-executors/javaagent/scala-executors-javaagent.gradle
instrumentation/scala-executors/javaagent/scala-executors-javaagent.gradle
apply from: "$rootDir/gradle/instrumentation.gradle"
-apply from: "$rootDir/gradle/test-with-scala.gradle"
+apply plugin: "otel.scala-conventions"
apply plugin: 'org.unbroken-dome.test-sets'
muzzle {

Migrate scala to convention plugin. (#3313)