Fragment Bundles with bndtools

315 views
Skip to first unread message

Kamesh Sampath

unread,
Mar 12, 2015, 10:16:42 AM3/12/15
to bndtool...@googlegroups.com
Hi, 

I am trying to create a Extension Fragment bundle tied to a system.bundle, how can i specify those special instructions in bnd.bnd ?

I was able to do it with eclipse PDE manifest editor but dont know how to do it with bndtools. Ideally i need the following two instructions to get in to my MANIFEST.MF,

Fragment-Host: system.bundle
ExtensionBundle-Activator: com.abc.XyzActivator

En route doing it how does my bndtools know which is my "system.bundle" ?

-Kamesh

Kamesh Sampath

unread,
Mar 12, 2015, 10:35:35 AM3/12/15
to bndtool...@googlegroups.com
I had the following instructions to my bnd.bnd

Bundle-Version: 1.0.0.${tstamp}

-buildpath: \

osgi.core;version=6.0,\

osgi.cmpn;version=5.0,\

org.eclipse.osgi;version=3.10

Private-Package: \

org.workspace7.osgi.logger,\

org.workspace7.osgi.logger.internal

Fragment-Host: system.bundle

ExtensionBundle-Activator: org.workspace7.osgi.logger.LoggerActivator


never knew that additional manifest instructions are copied as such on to generated manifest file. 

Please correct me if my understanding is wrong.

-Kamesh

Neil Bartlett

unread,
Mar 12, 2015, 1:57:51 PM3/12/15
to bndtool...@googlegroups.com
Hello Kamesh,

As I think you have already worked out, you can add any headers you like to a bnd file and it will be copied (after possibly processing macros) into the resulting manifest… IF the header name begins with a capital letter. Headers beginning with a lowercase letter or hyphen are used as internal variables or instructions, and are not copied.

You also asked about the name “system.bundle”. This is a special name defined in the OSGi specification as an alias. So Bndtools knows that it is always provided by the framework.

Regards,
Neil


--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kamesh Sampath

unread,
Mar 13, 2015, 1:47:18 AM3/13/15
to bndtool...@googlegroups.com
Thanks for clarifications Neil.

Kamesh Sampath

unread,
Mar 17, 2015, 1:52:54 AM3/17/15
to bndtool...@googlegroups.com
Hello Neil,

I kind of ran in out issues when using bndtools to generate the extension bundle - the reason was that when i leave the bndtools to generate the MANIFEST.MF for my fragment bundle its trying to do the generate  Import-Packages which is illegal when its Extension Bundle. So I have to resort to having a MANIFEST.MF and add the -manifest macro to the bnd.bnd to use my custom MANIFEST.MF.

Is there any plan to add support to "Extension Bundles" in 3.x ? I see we can add something like -ext to the bnd.bnd so that the bndtools generator is aware its a "Extension Bundle" and can skip adding the illegal headers as per spec.

Thoughts?

-Kamesh

On Thursday, March 12, 2015 at 11:27:51 PM UTC+5:30, Neil Bartlett wrote:

Neil Bartlett

unread,
Mar 17, 2015, 2:47:58 AM3/17/15
to bndtool...@googlegroups.com
You can suppress generation of Import-Package by adding this to your bnd:

    Import-Package: !*

Regards
Neil

--
Neil Bartlett
Sent from a phone

Kamesh Sampath

unread,
Mar 17, 2015, 2:52:55 AM3/17/15
to bndtool...@googlegroups.com
Thanks Neil, it worked!


-- 
Kamesh Sampath, Sr. Architect
Liferay Global Services, Inc. 


--
You received this message because you are subscribed to a topic in the Google Groups "bndtools-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bndtools-users/mEV97tnokA4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bndtools-user...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages