@@ -8,6 +8,7 @@ plugins {
88 eclipse
99 idea
1010
11+ id(" biz.aQute.bnd.builder" )
1112 id(" otel.spotless-conventions" )
1213}
1314
@@ -59,6 +60,9 @@ tasks {
5960 )
6061 }
6162
63+ systemProperty(" felix.cache.dir" , buildDir)
64+ systemProperty(" felix.bundle.path" , " $buildDir /libs/${project.base.archivesName.get()} -${project.version} .jar" )
65+
6266 testLogging {
6367 exceptionFormat = TestExceptionFormat .FULL
6468 showExceptions = true
@@ -88,11 +92,17 @@ tasks {
8892
8993 manifest {
9094 attributes(
91- " Automatic-Module-Name" to otelJava.moduleName,
95+ " Automatic-Module-Name" to otelJava.moduleName,
9296 " Built-By" to System .getProperty(" user.name" ),
9397 " Built-JDK" to System .getProperty(" java.version" ),
9498 " 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+ )
96106 }
97107 }
98108
0 commit comments