• 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
  • findfile ';' PATH ( ';' FILTER )

    Prev Next
    Project
    Get filtered list of file paths from a directory tree

    Summary

    The findfile macro recursively searches a directory and returns a filtered list of relative file paths matching the specified filter pattern.

    Syntax

    ${findfile;<directory>[;<filter>]}
    

    Parameters

    • directory - Base directory to search (relative to project)
    • filter (optional) - Instruction pattern to match files (default: all files)

    Behavior

    • Recursively traverses the directory tree
    • Returns relative paths from the base directory
    • Filters paths using instruction pattern matching
    • Returns comma-separated list of matching paths

    Examples

    Find all files:

    ${findfile;src}
    

    Find Java source files:

    ${findfile;src;*.java}
    

    Find with exclusion pattern:

    ${findfile;resources;!*.tmp}
    

    Use Cases

    • File discovery
    • Build input collection
    • Resource gathering
    • Pattern-based file selection

    Notes

    • Paths are relative to the base directory
    • Uses bnd instruction pattern matching
    • See also: ${findname}, ${findpath}

    See test cases in MacroTestsForDocsExamples.java

Prev Next
Search
    • Home