A workingset is a name for a group of projects that have something in common. You can tag a project for one or more workingsets using the -workingset
instruction in the bnd.bnd
file. For example, to make a project member of the Implementations
and Drivers
working sets you can enter the following in a bnd file:
-workingset Implementations, Drivers
An IDE can use this information to provide a grouping to projects. However, this information can also be used to tag bundles in the Manifest, like:
Bundle-Category ${-workingset.*}
The syntax for the instruction is:
workingset := '-workingset' tag ( ',' tag )*
tag := NAME ( ';member=' TRUTHY )?
NAME := <JavaIdentifierPart+>
The instruction is a merged instruction so you can also set:
-workingset.all All
Note that, the name of the working set must use the pattern of Java identifier.
As you could see in the syntax, you can also specify a member
attribute on the tag. This member attribute evaluates to a truthy. A truthy is true
if it is not empty, 0, nor false
. The truthy is well supported by macros so you can now use the bnd macro language to decide if a project should be a member of a working set or not. This can be used in many ways. For example, you could use it to do name matching. By placing the following in the cnf/build.bnd
file you do not have to place the -workingset
instruction in each bnd file.
-workingset = \
impl;member=${filter;${p};.*\.provider}, \
api;member=${filter;${p};.*\.api}, \
test;member=${filter;${p};.*\.test}
The feature will create working sets as demanded but will reuse existing working set with the matching name. If no -workingset
instruction is given, the working sets are not touched in any way for that project. That is, they are then not removed from existing sets.