stempler / bnd-platform

Build OSGi bundles and Eclipse Update Sites from existing JARs, e.g. from Maven repositories (Plugin for Gradle)
Apache License 2.0
79 stars 30 forks source link

OptionalImport not working #61

Closed frankbenoit closed 5 years ago

frankbenoit commented 5 years ago

Hi

I try to use this tool the first time, so I might miss something :-)
I try beside others to process this plugin:

bundle ('io.projectreactor.addons:reactor-extra:3.+') {
    bnd {
        optionalImport 'kotlin'
        optionalImport 'kotlin.jvm.functions'
        optionalImport 'kotlin.jvm.internal'
    }
}

But the created file still has those packages in the imports non-optional:

Import-Package: javax.annotation,javax.swing,kotlin,kotlin.jvm.functio
 ns,kotlin.jvm.internal,org.eclipse.swt.widgets,org.reactivestreams,re
 actor.core,reactor.core.publisher,reactor.core.scheduler,reactor.sche
 duler.clock;version="[3.2,4)",reactor.util,reactor.util.annotation,re
 actor.util.context,reactor.util.function

Can someone help please?

cu Frank

stempler commented 5 years ago

Hi Frank,

My guess would be that the problem is the dynamic version you used. You could try defining the bnd instructions independent of the version, e.g.:

platform {
  bundle ('io.projectreactor.addons:reactor-extra:3.+')

  bnd(group: 'io.projectreactor.addons', name: 'reactor-extra') {
    optionalImport 'kotlin.*'
  }
}

Hope that helps.

Best, Simon

frankbenoit commented 5 years ago

Hi Simon,

this works, thanks!

cu Frank