1
votes

I am doing some development using Bndtools. Bndtools provides, out of the box, OSGi runtimes for Apache Felix and (apparently) for Equinox.

Suppose, however, you want to develop bundles and test them in Bndtools in Knopflerfish? Or for some company's proprietary container (yes, they do exist, amazingly enough!)? Bndtools makes it easy to add individual bundles to the development environment, but there doesn't seem to be any obvious way to add a complete runtime for testing.

Is there some way that someone can add alternate OSGi runtime environments to Bndtools?

2

2 Answers

2
votes

Just get hold of the framework JAR and drag-drop it to one of your repositories, e.g. the Local repository. Then it will appear on the OSGi Framework dropdown list in the Run editor.

NB you will probably have to close and reopen the editor in order to refresh the dropdown contents.

1
votes

The idea in bnd(tools) is to define your runtime in bndrun files. You can create as many bndrun files as you want. A bndrun file contains the setup of the environment (framework, system packages, properties, etc.) and a list of bundles. Framework and bundles come from the repositories. As Neil indicated, you can add different frameworks by adding them to a repository.

You can include files with -include in bndrun files for shared variables between different bndrun files. It is then best to use the resolver to create the list of -runbundles.

In OSGi enRoute we create different runtimes for the actual application and the debug environment this way. See the OSGi enRoute cm example, look at the debug.bndrun and osgi.enroute.exampes.cm.bndrun file. Notice that the debug.bndrun file includes the osgi.enroute.exampes.cm.bndrun file so any setup is automatically inherited. Also note the use of merged properties that allows you to add properties without stepping on the toes of an included file.