• Intro Headers Instructions Macros Commands
Fork me on GitHub
    • Getting Started
      • Introduction
      • How to install bnd
      • Guided Tour Workspace & Projects
      • bnd / bndlib Features and JAR Wrapping Techniques
      • FAQ - Frequently Asked Questions
    • Concepts and Practices
      • Concepts
      • Background
      • Best practices
    • Build and Development
      • Build
      • Generating JARs
      • Versioning
      • Baselining
      • Service Components
      • Metatype
      • Contracts
      • Bundle Annotations
      • Accessor Properties
      • SPI Annotations
    • Dependency and Launching
      • Resolving Dependencies
      • Launching
      • Startlevels
    • Testing
      • Testing
      • Testing with Launchpad
    • Packaging and Distribution
      • Packaging Applications
      • JPMS Libraries
      • Wrapping Libraries to OSGi Bundles
    • Documentation and Tools
      • Generating Documentation
      • bnd CLI Commands
      • For Developers
      • Templates for Workspaces
      • Tips for Windows users
      • Tools bound to bnd
    • Reference Material
      • Reference
      • Headers
      • Instruction Reference
      • Instruction Index
      • Macro Reference
      • Macro Index
      • Plugins
      • External Plugins
    • Configuration and Troubleshooting
      • Settings
      • Errors
      • Warnings
  • workspace

    Prev
    Workspace
    Get the absolute path to the workspace directory

    Summary

    The workspace macro returns the absolute file path to the current bnd workspace directory.

    Syntax

    ${workspace}
    

    Parameters

    None - this macro takes no parameters.

    Behavior

    • Returns absolute path to workspace root
    • The workspace is the directory containing cnf/
    • Path uses OS-specific separators

    Examples

    Get workspace path:

    Workspace-Location: ${workspace}
    

    Reference workspace files:

    config.file=${workspace}/cnf/build.bnd
    

    Relative to workspace:

    ${if;${startswith;${basedir};${workspace}};in-workspace;external}
    

    Use Cases

    • Referencing workspace-level files
    • Configuration paths
    • Build metadata
    • Multi-project coordination
    • Workspace-relative paths

    Notes

    • Returns absolute path
    • Points to workspace root (contains cnf/)
    • See also: ${basedir} for project directory
    • See also: ${propertiesdir} for config file directory

    See test cases in MacroTestsForDocsExamples.java

Prev
Search
    • Home