Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 714 Bytes

functions.md

File metadata and controls

23 lines (16 loc) · 714 Bytes

Build Functions

Some Functions can be called in BUILD files.

glob

glob(include, exclude=[], allow_empty=False)

Glob is a helper function that finds all files that match certain path patterns in the source dir, and returns a list of their paths. Patterns may contain shell-like wildcards, such as * , ? , or [charset]. Additionally, the path element '**' matches any subpath. You can use exclude to exclude some files.

Example:

...
    srcs = glob(['*.java', 'src/main/java/**/*.java'], exclude=['*Test.java'])
...

Usually, it is an error for glob to return an empty result, but you can specify allow_empty=True to eliminate this error if it is surely you expected.