mozilla / rhino

Rhino is an open-source implementation of JavaScript written entirely in Java
https://rhino.github.io
Other
4.12k stars 848 forks source link

OSGi Manifest for engine #1277

Open stbischof opened 1 year ago

stbischof commented 1 year ago

https://github.com/mozilla/rhino/blob/1cb60025967fdc82f5ae06163379936fa0afd74f/build.gradle#L203

could you please add a OSGI-Entries intomanifest to the engine bundle?

            "Bundle-ManifestVersion": "2",
            "Bundle-SymbolicName": "org.mozilla.rhino-engine",
            "Bundle-Version": project.version.replaceAll("-.*", ""),
            "Export-Package": "org.mozilla.javascript.engine",
            "Import-Package": "javax.script,org.mozilla.javascript"

if gradle should do the job bnd hast a great plugin to do this Example here: https://github.com/osgi/osgi-test/tree/main/examples/osgi-test-example-gradle

p-bakker commented 1 month ago

@gbrail

From https://github.com/mozilla/rhino/pull/1479#issuecomment-2155673632

We CAN add an OSGi manifest, but this PR introduces proper Java modules that meet all the rules of Java modularity. If people also want OSGi we can add it. Is that still necessary if we add modules?

From a little reading I did, having the OSGI stuff inside the jars is still usefull/needed if you want to make use of the additional features that osgi layers on top of JPMS:

If you want to use OSGi's dynamic module management, service registry, or other OSGi-specific features, then you need to add the necessary OSGi metadata to your JAR files

So I think merging #1278 is useful