Skip to content

Commit ff2f9ca

Browse files
committed
solves #768: Add OSGi support by exporting all java packages except internal packages
1 parent 97b3fa4 commit ff2f9ca

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

buildSrc/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ repositories {
5050
}
5151

5252
dependencies {
53+
implementation("biz.aQute.bnd:biz.aQute.bnd.gradle:7.0.0")
5354
implementation(enforcedPlatform("com.squareup.wire:wire-bom:5.0.0"))
5455
implementation("com.google.auto.value:auto-value-annotations:1.11.0")
5556
// When updating, update above in plugins too

buildSrc/src/main/kotlin/otel.java-conventions.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ plugins {
88
eclipse
99
idea
1010

11+
id("biz.aQute.bnd.builder")
1112
id("otel.errorprone-conventions")
1213
id("otel.jacoco-conventions")
1314
id("otel.spotless-conventions")
@@ -155,10 +156,15 @@ tasks {
155156
"Built-JDK" to System.getProperty("java.version"),
156157
"Implementation-Title" to project.name,
157158
"Implementation-Version" to project.version,
159+
// BND plugin to export the packages as OSGi bundle
160+
"-exportcontents" to "!io.opentelemetry.**.internal,io.opentelemetry.*,"
158161
)
159162
}
163+
160164
}
161165

166+
167+
162168
afterEvaluate {
163169
withType<Javadoc>().configureEach {
164170
with(options as StandardJavadocDocletOptions) {

0 commit comments

Comments
 (0)