Paul Verest
Paul Verest

Reputation: 63912

bnd - Make resulted MANIFEST.MF to have one line per Bundle-ClassPath and RequireBundle entries

With OSGi tool bnd

If bnd.bnd file has

-buildpath: mod.base,\
    mod.common,\
    ...

those lines will be as one-liner, though wrapped at 72 potion. That make output harder to read.

Require-Bundle: mod.base,mod.common,...

How to tell bdn to make resulted MANIFEST.MF to have one line per Bundle-ClassPath and RequireBundle entries

Upvotes: 1

Views: 598

Answers (2)

Balazs Zsoldos
Balazs Zsoldos

Reputation: 6046

As much as I saw in the source of bnd, it creates a java.util.jar.Manifest object. Serializing the content to disk is made with ManifestUtil, because of some limitation with the output of the Manifest class provided by Java.

I use an online tool when when I want to read the OSGi headers: https://robinst.github.io/jar-manifest-formatter/

Although this does not format Require-Bundle, Provide-Capability and Require-Capability headers, I think it should not take more than 10 minutes for you to change the javascript file to format those, too. If you do that, I suggest that you should send a PR for robinst ;).

UPDATE: It can already, thanks to Robin

Upvotes: 2

Neil Bartlett
Neil Bartlett

Reputation: 23948

The MANIFEST.MF format is defined by the Jar File Specification and it is not intended to be particularly human-readable.

You can format the manifest of any bundle using the bnd command. From the command line:

bnd print <filename.jar>

This will print the imports and exports, as well as the uses constraints, in a nice layout.

By the way... don't use Require-Bundle.

Upvotes: 3

Related Questions