Skip to content

Commit 3dae10e

Browse files
authored
Make the use of otelExtension optional (#209)
1 parent 13dfb54 commit 3dae10e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

otel/src/main/kotlin/com/ryandens/javaagent/otel/JavaagentOTelModificationPlugin.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import org.gradle.api.Plugin
55
import org.gradle.api.Project
66
import org.gradle.api.file.DuplicatesStrategy
77
import org.gradle.jvm.tasks.Jar
8+
import java.io.File
89

910
/**
1011
* Enables easy consumption of external extensions and instrumentation libraries by creating a new jar with extra
@@ -54,7 +55,11 @@ class JavaagentOTelModificationPlugin : Plugin<Project> {
5455
jar.from(otel.map { project.zipTree(it.singleFile) }) {
5556
it.exclude("inst/META-INF/services/**")
5657
}
57-
jar.from(otelExtension.map { it.singleFile }) {
58+
jar.from(
59+
otelExtension.map { config ->
60+
if (!config.isEmpty) config.singleFile else emptyList<File>()
61+
},
62+
) {
5863
it.into("extensions")
5964
}
6065
jar.manifest {

0 commit comments

Comments
 (0)