diff --git a/bom-alpha/build.gradle.kts b/bom-alpha/build.gradle.kts index 4eb6acede733..8240a92ca337 100644 --- a/bom-alpha/build.gradle.kts +++ b/bom-alpha/build.gradle.kts @@ -10,6 +10,9 @@ javaPlatform { allowDependencies() } +// Need this since we access :dependencyManagement configurations below +evaluationDependsOn(":dependencyManagement") + dependencies { api(platform("io.opentelemetry:opentelemetry-bom")) api(platform("io.opentelemetry:opentelemetry-bom-alpha")) diff --git a/bom/build.gradle.kts b/bom/build.gradle.kts index b8745c9a1676..5e3147c7d2a8 100644 --- a/bom/build.gradle.kts +++ b/bom/build.gradle.kts @@ -10,6 +10,9 @@ javaPlatform { allowDependencies() } +// Need this since we access :dependencyManagement configurations below +evaluationDependsOn(":dependencyManagement") + dependencies { api(platform("io.opentelemetry:opentelemetry-bom")) diff --git a/conventions/src/main/kotlin/otel.bom-conventions.gradle.kts b/conventions/src/main/kotlin/otel.bom-conventions.gradle.kts index 22ea123789a6..43ff03c469ca 100644 --- a/conventions/src/main/kotlin/otel.bom-conventions.gradle.kts +++ b/conventions/src/main/kotlin/otel.bom-conventions.gradle.kts @@ -9,11 +9,14 @@ if (!project.name.startsWith("bom")) { throw IllegalStateException("Name of BOM projects must start with 'bom'.") } +// Force evaluation of all non-BOM subprojects so that we can filter them by plugin +// and add them as dependency constraints below rootProject.subprojects.forEach { subproject -> if (!subproject.name.startsWith("bom")) { evaluationDependsOn(subproject.path) } } + val otelBom = extensions.create("otelBom") afterEvaluate { @@ -41,7 +44,6 @@ afterEvaluate { } // this applies version numbers to the SDK bom and SDK alpha bom which are dependencies of the instrumentation boms -evaluationDependsOn(":dependencyManagement") val dependencyManagementConf = configurations.create("dependencyManagement") { isCanBeConsumed = false isCanBeResolved = false diff --git a/conventions/src/main/kotlin/otel.java-conventions.gradle.kts b/conventions/src/main/kotlin/otel.java-conventions.gradle.kts index 2f8b4776ee78..dba6d2abcf9c 100644 --- a/conventions/src/main/kotlin/otel.java-conventions.gradle.kts +++ b/conventions/src/main/kotlin/otel.java-conventions.gradle.kts @@ -121,7 +121,6 @@ afterEvaluate { } } -evaluationDependsOn(":dependencyManagement") val dependencyManagementConf = configurations.create("dependencyManagement") { isCanBeConsumed = false isCanBeResolved = false diff --git a/conventions/src/main/kotlin/otel.javaagent-testing.gradle.kts b/conventions/src/main/kotlin/otel.javaagent-testing.gradle.kts index c1cc4227806d..6d4a08072a6c 100644 --- a/conventions/src/main/kotlin/otel.javaagent-testing.gradle.kts +++ b/conventions/src/main/kotlin/otel.javaagent-testing.gradle.kts @@ -4,8 +4,6 @@ plugins { id("otel.java-conventions") } -evaluationDependsOn(":testing:agent-for-testing") - dependencies { annotationProcessor("com.google.auto.service:auto-service") compileOnly("com.google.auto.service:auto-service")