@@ -8,6 +8,7 @@ plugins {
8
8
eclipse
9
9
idea
10
10
11
+ id(" biz.aQute.bnd.builder" )
11
12
id(" otel.spotless-conventions" )
12
13
}
13
14
@@ -59,6 +60,9 @@ tasks {
59
60
)
60
61
}
61
62
63
+ systemProperty(" felix.cache.dir" , buildDir)
64
+ systemProperty(" felix.bundle.path" , " $buildDir /libs/${project.base.archivesName.get()} -${project.version} .jar" )
65
+
62
66
testLogging {
63
67
exceptionFormat = TestExceptionFormat .FULL
64
68
showExceptions = true
@@ -88,11 +92,17 @@ tasks {
88
92
89
93
manifest {
90
94
attributes(
91
- " Automatic-Module-Name" to otelJava.moduleName,
95
+ " Automatic-Module-Name" to otelJava.moduleName,
92
96
" Built-By" to System .getProperty(" user.name" ),
93
97
" Built-JDK" to System .getProperty(" java.version" ),
94
98
" Implementation-Title" to project.base.archivesName,
95
- " Implementation-Version" to project.version)
99
+ " Implementation-Version" to project.version,
100
+ // Add OSGi manifest headers with bnd
101
+ " -exportcontents" to " ${otelJava.moduleName.get()} .*" ,
102
+ " Bundle-Name" to otelJava.bundleName,
103
+ " Bundle-SymbolicName" to " ${otelJava.moduleName.get()} .${project.base.archivesName.get()} " ,
104
+ " Import-Package" to " io.opentelemetry.api.*;resolution:=optional" // FIXME: should not be optional, dependency should be provided
105
+ )
96
106
}
97
107
}
98
108
0 commit comments