xref: /aosp_15_r20/external/bazel-skylib/docs/expand_template_doc.md (revision bcb5dc7965af6ee42bf2f21341a2ec00233a8c8a)
1<!-- Generated with Stardoc: http://skydoc.bazel.build -->
2
3A rule that performs template expansion.
4
5<a id="expand_template"></a>
6
7## expand_template
8
9<pre>
10expand_template(<a href="#expand_template-name">name</a>, <a href="#expand_template-out">out</a>, <a href="#expand_template-substitutions">substitutions</a>, <a href="#expand_template-template">template</a>)
11</pre>
12
13Template expansion
14
15This performs a simple search over the template file for the keys in
16substitutions, and replaces them with the corresponding values.
17
18There is no special syntax for the keys. To avoid conflicts, you would need to
19explicitly add delimiters to the key strings, for example "{KEY}" or "@KEY@".
20
21**ATTRIBUTES**
22
23
24| Name  | Description | Type | Mandatory | Default |
25| :------------- | :------------- | :------------- | :------------- | :------------- |
26| <a id="expand_template-name"></a>name |  A unique name for this target.   | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required |  |
27| <a id="expand_template-out"></a>out |  The destination of the expanded file.   | <a href="https://bazel.build/concepts/labels">Label</a> | required |  |
28| <a id="expand_template-substitutions"></a>substitutions |  A dictionary mapping strings to their substitutions.   | <a href="https://bazel.build/rules/lib/dict">Dictionary: String -> String</a> | required |  |
29| <a id="expand_template-template"></a>template |  The template file to expand.   | <a href="https://bazel.build/concepts/labels">Label</a> | required |  |
30
31
32