• 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
  • propertiesname

    Prev Next
    Project
    Get the filename of the current properties file

    Summary

    The propertiesname macro returns the filename (without path) of the properties file being processed. This is typically bnd.bnd for projects or workspace configuration files.

    Syntax

    ${propertiesname}
    

    Parameters

    None - this macro takes no parameters.

    Behavior

    • Returns the filename of the current properties file
    • Returns empty string if no properties file is set
    • Returns only the filename, not the full path

    Examples

    Get current file name:

    Current-File: ${propertiesname}
    # Returns: "bnd.bnd" or "my.bndrun", etc.
    

    Use in logging:

    Build-Info: Built from ${propertiesname}
    

    Conditional based on file:

    ${if;${equals;${propertiesname};test.bnd};test-mode;normal-mode}
    

    Use Cases

    • Identifying which configuration file is being processed
    • Logging and debugging
    • Conditional configuration based on file name
    • Documentation generation
    • Build metadata

    Notes

    • Returns only the filename, not the directory path
    • Returns empty string if no properties file
    • Typically “bnd.bnd” for projects
    • See also: ${propertiesdir} for the directory path
    • See also: ${basedir} for the project base directory

    TODO Needs review - AI Generated content


    See test cases in MacroTestsForDocsExamples.java

Prev Next
Search
    • Home