From d1ba7c4b1add825c517d7a726d1dcf71444bfcbe Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Sat, 22 Feb 2025 11:02:39 -0800 Subject: [PATCH] Include the incubating dependency in the published pom as an optional dependency --- sdk/logs/build.gradle.kts | 19 ++++++++++++++++++- sdk/metrics/build.gradle.kts | 19 ++++++++++++++++++- sdk/trace/build.gradle.kts | 16 +++++++++++++++- 3 files changed, 51 insertions(+), 3 deletions(-) diff --git a/sdk/logs/build.gradle.kts b/sdk/logs/build.gradle.kts index c0c740d3743..f079a4684d3 100644 --- a/sdk/logs/build.gradle.kts +++ b/sdk/logs/build.gradle.kts @@ -9,10 +9,27 @@ plugins { description = "OpenTelemetry Log SDK" otelJava.moduleName.set("io.opentelemetry.sdk.logs") +sourceSets { + create("incubating") +} + +java { + registerFeature("incubating") { + usingSourceSet(sourceSets["incubating"]) + } +} + +val incubatingImplementation by configurations.existing + +val compileOnly by configurations.existing { + extendsFrom(incubatingImplementation.get()) +} + dependencies { api(project(":api:all")) api(project(":sdk:common")) - compileOnly(project(":api:incubator")) + + incubatingImplementation(project(":api:incubator")) annotationProcessor("com.google.auto.value:auto-value") diff --git a/sdk/metrics/build.gradle.kts b/sdk/metrics/build.gradle.kts index a0b667943c8..e739d4e1cf9 100644 --- a/sdk/metrics/build.gradle.kts +++ b/sdk/metrics/build.gradle.kts @@ -12,10 +12,27 @@ plugins { description = "OpenTelemetry SDK Metrics" otelJava.moduleName.set("io.opentelemetry.sdk.metrics") +sourceSets { + create("incubating") +} + +java { + registerFeature("incubating") { + usingSourceSet(sourceSets["incubating"]) + } +} + +val incubatingImplementation by configurations.existing + +val compileOnly by configurations.existing { + extendsFrom(incubatingImplementation.get()) +} + dependencies { api(project(":api:all")) api(project(":sdk:common")) - compileOnly(project(":api:incubator")) + + incubatingImplementation(project(":api:incubator")) compileOnly("org.codehaus.mojo:animal-sniffer-annotations") diff --git a/sdk/trace/build.gradle.kts b/sdk/trace/build.gradle.kts index 35d30c8513b..fc69fa1023f 100644 --- a/sdk/trace/build.gradle.kts +++ b/sdk/trace/build.gradle.kts @@ -16,13 +16,27 @@ sourceSets { val traceShadedDeps = project(":sdk:trace-shaded-deps") output.dir(traceShadedDeps.file("build/extracted/shadow"), "builtBy" to ":sdk:trace-shaded-deps:extractShadowJar") } + create("incubating") +} + +java { + registerFeature("incubating") { + usingSourceSet(sourceSets["incubating"]) + } +} + +val incubatingImplementation by configurations.existing + +val compileOnly by configurations.existing { + extendsFrom(incubatingImplementation.get()) } dependencies { api(project(":api:all")) api(project(":sdk:common")) - compileOnly(project(":api:incubator")) + incubatingImplementation(project(":api:incubator")) + compileOnly(project(":sdk:trace-shaded-deps")) annotationProcessor("com.google.auto.value:auto-value")