xref: /aosp_15_r20/external/bazel-skylib/docs/directory_glob_doc.md (revision bcb5dc7965af6ee42bf2f21341a2ec00233a8c8a)
1<!-- Generated with Stardoc: http://skydoc.bazel.build -->
2
3Rules to filter files from a directory.
4
5<a id="directory_glob"></a>
6
7## directory_glob
8
9<pre>
10directory_glob(<a href="#directory_glob-name">name</a>, <a href="#directory_glob-srcs">srcs</a>, <a href="#directory_glob-data">data</a>, <a href="#directory_glob-allow_empty">allow_empty</a>, <a href="#directory_glob-directory">directory</a>, <a href="#directory_glob-exclude">exclude</a>)
11</pre>
12
13globs files from a directory by relative path.
14
15Usage:
16
17```
18directory_glob(
19    name = "foo",
20    directory = ":directory",
21    srcs = ["foo/bar"],
22    data = ["foo/**"],
23    exclude = ["foo/**/*.h"]
24)
25```
26
27**ATTRIBUTES**
28
29
30| Name  | Description | Type | Mandatory | Default |
31| :------------- | :------------- | :------------- | :------------- | :------------- |
32| <a id="directory_glob-name"></a>name |  A unique name for this target.   | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required |  |
33| <a id="directory_glob-srcs"></a>srcs |  A list of globs to files within the directory to put in the files.<br><br>For example, `srcs = ["foo/**"]` would collect the file at `<directory>/foo` into the files.   | List of strings | optional |  `[]`  |
34| <a id="directory_glob-data"></a>data |  A list of globs to files within the directory to put in the runfiles.<br><br>For example, `data = ["foo/**"]` would collect all files contained within `<directory>/foo` into the runfiles.   | List of strings | optional |  `[]`  |
35| <a id="directory_glob-allow_empty"></a>allow_empty |  If true, allows globs to not match anything.   | Boolean | optional |  `False`  |
36| <a id="directory_glob-directory"></a>directory |  -   | <a href="https://bazel.build/concepts/labels">Label</a> | required |  |
37| <a id="directory_glob-exclude"></a>exclude |  A list of globs to files within the directory to exclude from the files and runfiles.   | List of strings | optional |  `[]`  |
38
39
40