Add semconv to alpha bom (#9425)
This commit is contained in:
parent
10480adc64
commit
b2b1eb19e1
|
@ -14,6 +14,13 @@ dependencies {
|
|||
api(platform("io.opentelemetry:opentelemetry-bom"))
|
||||
api(platform("io.opentelemetry:opentelemetry-bom-alpha"))
|
||||
api(platform(project(":bom")))
|
||||
|
||||
// Get the semconv version from :dependencyManagement
|
||||
val semconvConstraint = project(":dependencyManagement").dependencyProject.configurations["api"].allDependencyConstraints
|
||||
.find { it.group.equals("io.opentelemetry.semconv")
|
||||
&& it.name.equals("opentelemetry-semconv") }
|
||||
?: throw Exception("semconv constraint not found")
|
||||
otelBom.addExtra(semconvConstraint.group, semconvConstraint.name, semconvConstraint.version ?: throw Exception("missing version"))
|
||||
}
|
||||
|
||||
otelBom.projectFilter.set { it.findProperty("otel.stable") != "true" }
|
||||
|
|
|
@ -11,4 +11,9 @@ import java.util.function.Predicate
|
|||
|
||||
abstract class OtelBomExtension {
|
||||
abstract val projectFilter: Property<Predicate<Project>>
|
||||
val additionalDependencies: MutableSet<String> = hashSetOf()
|
||||
|
||||
fun addExtra(groupId: String, artifactId: String, version: String) {
|
||||
this.additionalDependencies.add(groupId + ":" + artifactId + ":" + version)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,13 @@ afterEvaluate {
|
|||
}
|
||||
}
|
||||
}
|
||||
otelBom.additionalDependencies.forEach { dependency ->
|
||||
dependencies {
|
||||
constraints {
|
||||
api(dependency)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// this applies version numbers to the SDK bom and SDK alpha bom which are dependencies of the instrumentation boms
|
||||
|
|
Loading…
Reference in New Issue