• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1## write_file
2
3<pre>
4write_file(<a href="#write_file-name">name</a>, <a href="#write_file-out">out</a>, <a href="#write_file-content">content</a>, <a href="#write_file-is_executable">is_executable</a>, <a href="#write_file-newline">newline</a>, <a href="#write_file-kwargs">kwargs</a>)
5</pre>
6
7Creates a UTF-8 encoded text file.
8
9### Parameters
10
11<table class="params-table">
12  <colgroup>
13    <col class="col-param" />
14    <col class="col-description" />
15  </colgroup>
16  <tbody>
17    <tr id="write_file-name">
18      <td><code>name</code></td>
19      <td>
20        required.
21        <p>
22          Name of the rule.
23        </p>
24      </td>
25    </tr>
26    <tr id="write_file-out">
27      <td><code>out</code></td>
28      <td>
29        required.
30        <p>
31          Path of the output file, relative to this package.
32        </p>
33      </td>
34    </tr>
35    <tr id="write_file-content">
36      <td><code>content</code></td>
37      <td>
38        optional. default is <code>[]</code>
39        <p>
40          A list of strings. Lines of text, the contents of the file.
41    Newlines are added automatically after every line except the last one.
42        </p>
43      </td>
44    </tr>
45    <tr id="write_file-is_executable">
46      <td><code>is_executable</code></td>
47      <td>
48        optional. default is <code>False</code>
49        <p>
50          A boolean. Whether to make the output file executable.
51    When True, the rule's output can be executed using `bazel run` and can
52    be in the srcs of binary and test rules that require executable
53    sources.
54        </p>
55      </td>
56    </tr>
57    <tr id="write_file-newline">
58      <td><code>newline</code></td>
59      <td>
60        optional. default is <code>"auto"</code>
61        <p>
62          one of ["auto", "unix", "windows"]: line endings to use. "auto"
63    for platform-determined, "unix" for LF, and "windows" for CRLF.
64        </p>
65      </td>
66    </tr>
67    <tr id="write_file-kwargs">
68      <td><code>kwargs</code></td>
69      <td>
70        optional.
71        <p>
72          further keyword arguments, e.g. <code>visibility</code>
73        </p>
74      </td>
75    </tr>
76  </tbody>
77</table>
78
79
80