From 0d47967512f0a0457fd60fb2855b7b614684dd1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Basl=C3=A9?= Date: Tue, 3 Dec 2019 11:28:55 +0100 Subject: [PATCH] fix #920 OSGI: explicit SymbolicName and fix imports-exports - the `Import-Package` clause was missing an entry `io.netty.util.internal;version="[ 4.1,5)"` and had an unneeded one `reactor.netty.internal` - the `Bundle-SymbolicName` clause was changed to project name instead of a more fully qualified name - we now use explicit Export-Package rather than exporcontents (but with no wildcard, to avoid all classes ending up in jar...) Reviewed-In: #921 --- build.gradle | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index 013ca38600..4a3ea27eba 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import org.gradle.api.internal.plugins.osgi.OsgiHelper buildscript { repositories { @@ -41,7 +40,6 @@ ext { realVersion = version.toString().replace("BUILD-SNAPSHOT", versionBranch + ".BUILD-SNAPSHOT") project.version = realVersion println "Building special snapshot ${project.version}" - println "OSGI version would be: ${new OsgiHelper().getVersion(project.version.toString())}" } } @@ -70,6 +68,13 @@ ext { "https://projectreactor.io/docs/core/release/api/", "https://netty.io/4.1/api/", "https://projectreactor.io/docs/netty/release/api/",] as String[] + + bndOptions = [ + "Export-Package": "!reactor.netty.internal*,reactor.netty.*;-noimport:=true", + "Import-Package": '!javax.annotation,io.netty.channel.kqueue;resolution:=optional;version="[4.1,5)",*', + "Bundle-Name" : "reactor-netty", + "Bundle-SymbolicName" : "io.projectreactor.netty.reactor-netty" + ] } @@ -239,10 +244,7 @@ configure(rootProject) { project -> "Implementation-Title": project.name, "Implementation-Version": project.version) } - bnd( - "-exportcontents": "!*internal*,*;-noimport:=true", - "Import-Package": '!*internal*,!javax.annotation,io.netty.channel.kqueue;resolution:=optional;version="[4.1,5)",*' - ) + bnd(bndOptions) } check.dependsOn jacocoTestReport