I figured out the problem, or at least a work-around. For some reason sbt needs exportPackage to be a wildcard, at which point it includes those packages in the output jar and adds the right headers.OsgiKeys.importPackage := Seq("akka*;version=\"[2.1.0,3.0.0)\"","scala*;version=\"[2.10.0,2.11.0)\"","journal.io.api;version=\"[1.2,2.0)\";resolution:=optional","org.fusesource.leveldbjni;version=\"[1.4.1,2.0.0)\";resolution:=optional","org.iq80.leveldb;version=\"[1.4.1,2.0.0)\";resolution:=optional","*"),OsgiKeys.exportPackage := Seq("org.eligosource*"),Strange behavior. The way exports are defined in the maven bundle plugin is more intuitive.Regards,Raman
On Sunday, November 18, 2012 2:49:37 AM UTC-5, Raman Gupta wrote:Using sbt-osgi 0.5.0-snaphsot. sbt-osgi insists on adding a Private-Package header in lieue of an Export-Package header. If I specify an empty privatePackage := Seq("") then the output jar is empty. This is not the way regular bnd works, so I don't really understand what sbt-osgi is doing.Here are the settings that do not result in an export-package header -- instead sbt-osgi creates a Private-Package header (!):.settings(osgiSettings: _*).settings(OsgiKeys.exportPackage := Seq("org.eligosource.eventourced.core;version=\"0.5.0.vivo_1\"","org.eligosource.eventourced.journal;version=\"0.5.0.vivo_1\"","org.eligosource.eventourced.util;version=\"0.5.0.vivo_1\""),OsgiKeys.importPackage := Seq("akka*;version=\"[2.1.0,3.0.0)\"","scala*;version=\"[2.10.0,2.11.0)\"","journal.io.api;version=\"[1.2,2.0)\";resolution:=optional","org.fusesource.leveldbjni;version=\"[1.4.1,2.0.0)\";resolution:=optional","org.iq80.leveldb;version=\"[1.4.1,2.0.0)\";resolution:=optional","*"))Regards,Raman--
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To view this discussion on the web visit https://groups.google.com/d/msg/simple-build-tool/-/HSwFGQxaA74J.
To post to this group, send email to simple-b...@googlegroups.com.
To unsubscribe from this group, send email to simple-build-t...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/simple-build-tool?hl=en.
Agreed, but the default behavior of maven-bundle-plugin is far more intuitive than the default behavior of sbt-osgi, in the way that the plugin configures the default bnd settings for Export-Package and Private-Package. Please see "Default Behavior" at the page: http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.htmlThe big difference is that the plugin assumes the packages created by the source are to be exported (except for "impl" and "internal"), whereas sbt-osgi assumes they are private.
Issue opened: https://github.com/sbt/sbt-osgi/issues/2I took a look to see what would be involved in a patch, but its not obvious to me how to get SBT to provide the same type of meta-data to the plugin that Maven provides to the maven-bundle-plugin. I've never written an SBT plugin before, and my SBT experience is limited. Any assistance would be appreciated.