• Intro Headers Instructions Macros Commands
  • Fork me on GitHub
    • Introduction
    • How to install bnd
    • Guided Tour
    • Guided Tour Workspace & Projects
    • Concepts
    • Best practices
    • Build
    • Project Setup
    • Generating JARs
    • Versioning
    • Baselining
    • Service Components
    • Metatype
    • Contracts
    • Bundle Annotations
    • Accessor Properties
    • SPI Annotations
    • Resolving Dependencies
    • Launching
    • Startlevels
    • Testing
    • Testing with Launchpad
    • Packaging Applications
    • JPMS Libraries
    • Wrapping Libraries to OSGi Bundles
    • Generating Documentation
    • Commands
    • For Developers
    • Tips for Windows users
    • Tools bound to bnd
    • Headers
    • Instruction Reference
    • Instruction Index
    • Macro Reference
    • Macro Index
    • Plugins
    • External Plugins
    • Settings
    • Errors
    • Warnings
    • Frequently Asked Questions
  • shell [options]

    Description

    The shell function in bnd is primarily intended to exercise macros. Although the macro command made it possible to test a single macro, the awful interaction between the (ba)sh character interpretations for $ and quotes made this quite hard to use in practice. the shell therefore directly talks the macro language as you write it in a bnd.bnd file. Additionally, all bnd commands are also available.

    $ bnd shell
    Base Project com.example.project
    > p
    com.example.project
    > now
    Fri Sep 28 11:29:02 CEST 2018
    >
    

    When you start the shell bnd will try to find a project. If the -p options is specified it will first look in that directory, otherwise it will look in the current working directory. If no project is found, it will try to find the workspace set by bnd. If no workspace can be found, bnd will use the bnd defaults as properties.

    Properties

    A project inherits all properties from the workspace. So when bnd has a project in scope then all macros and properties are available defined in the project’s bnd.bnd file, the ./cnf/build.bnd file, and any files in ./cnf/ext/*.bnd. For example, javac.source is a property set by the workspace:

    > javac.source
    1.8
    >
    

    This raises the question: What properties are there? The shell also supports bnd commands and there is a properties command. However, there are a large number of properties so lets limit it to the properties that start with java:

    > properties -k java*
    javac.compliance                         1.8
    javac.source                             1.8
    javac.target                             1.8
    >
    

    Synopsis

    Options

    -p, --project  path-to-project
    

    Examples

    • GitHub