Skip to content

Commit

Permalink
Add gradle plugin for SDK extensions (open-telemetry#6558)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Rzeszutek authored and LironKS committed Oct 23, 2022
1 parent c2b6561 commit a65268f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
14 changes: 14 additions & 0 deletions conventions/src/main/kotlin/otel.sdk-extension.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// SDK extensions are very similar to library instrumentations, they can be used without the javaagent
// but since they depend on the SDK they must be loaded by the agent CL in the javaagent

plugins {
id("io.opentelemetry.instrumentation.library-instrumentation")

id("otel.jacoco-conventions")
id("otel.java-conventions")
id("otel.publish-conventions")
}

extra["mavenGroupId"] = "io.opentelemetry.instrumentation"

base.archivesName.set(projectDir.parentFile.name)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id("otel.library-instrumentation")
id("otel.sdk-extension")
}

dependencies {
Expand Down
6 changes: 6 additions & 0 deletions javaagent/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ project(":instrumentation").subprojects {
add(javaagentLibs.name, project(subProj.path))
}
}

plugins.withId("otel.sdk-extension") {
javaagentDependencies.run {
add(javaagentLibs.name, project(subProj.path))
}
}
}

tasks {
Expand Down

0 comments on commit a65268f

Please sign in to comment.