Avoid compiling latest deps test in regular builds
Resolves
MODIFY
conventions/src/main/kotlin/io.opentelemetry.instrumentation.base.gradle.kts
conventions/src/main/kotlin/io.opentelemetry.instrumentation.base.gradle.kts
@@ -118,6 +118,22 @@ if (testLatestDeps) {
}
}
}
+} else {
+ afterEvaluate {
+ // Disable compiling latest dep tests for non latest dep builds in CI. This is needed to avoid
+ // breaking build because of a new library version which could force backporting latest dep
+ // fixes to release branches.
+ // This is only needed for modules where base version and latest dep tests use a different
+ // source directory.
+ var latestDepCompileTaskNames = arrayOf("compileLatestDepTestJava", "compileLatestDepTestGroovy", "compileLatestDepTestScala")
+ for (compileTaskName in latestDepCompileTaskNames) {
+ if (tasks.names.contains(compileTaskName)) {
+ tasks.named(compileTaskName).configure {
+ enabled = false
+ }
+ }
+ }
+ }
}
tasks {

Avoid compiling latest deps test in regular builds (#7385)

Resolves
https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/7255