• Intro Headers Instructions Macros
  • Fork me on GitHub
    • Release
    • Introduction
    • How to install bnd
    • Guided Tour
    • Guided Tour Workspace & Projects
    • Concepts
    • Best practices
    • Build
    • Generating JARs
    • Versioning
    • Baselining
    • Service Components
    • Metatype
    • Contracts
    • Manifest Annotations
    • Resolving Dependencies
    • Launching
    • Testing
    • Packaging Applications
    • Wrapping Libraries to OSGi Bundles
    • From the command line
    • For Developers
    • Plugins
    • Tools bound to bnd
    • File Format
    • Header Reference
    • Instruction
    • Instruction Index
    • Macro Reference
    • Command Reference
    • Plugins Reference
    • Settings
    • Errors
    • Warnings
    • Frequently Asked Questions
    Supported by OSGi enRoute
  • -workingset PARAMETER ( ',' PARAMETER ) *

    A workingset is a named 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 workingsets 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
    

    More Advanced Usage

    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.

    • Contact
    • Developers
    • More