You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`native.genrule()` is sometimes used to copy files (often wishing to rename them). The 'copy_file' rule does this with a simpler interface than genrule.
25
+
26
+
This rule uses a Bash command on Linux/macOS/non-Windows, and a cmd.exe command on Windows (no Bash is required).
27
+
28
+
If using this rule with source directories, it is recommended that you use the
29
+
`--host_jvm_args=-DBAZEL_TRACK_SOURCE_DIRECTORIES=1` startup option so that changes
30
+
to files within source directories are detected. See
| <aid="copy_file-name"></a>name | Name of the rule. | none |
41
+
| <aid="copy_file-src"></a>src | A Label. The file or directory to make a copy of. (Can also be the label of a rule that generates a file or directory.) | none |
42
+
| <aid="copy_file-out"></a>out | Path of the output file, relative to this package. | none |
43
+
| <aid="copy_file-is_directory"></a>is_directory | treat the source file as a directory Workaround for https://github.com/bazelbuild/bazel/issues/12954| <code>False</code> |
44
+
| <aid="copy_file-is_executable"></a>is_executable | A boolean. Whether to make the output file executable. When True, the rule's output can be executed using <code>bazel run</code> and can be in the srcs of binary and test rules that require executable sources. WARNING: If <code>allow_symlink</code> is True, <code>src</code> must also be executable. | <code>False</code> |
45
+
| <aid="copy_file-allow_symlink"></a>allow_symlink | A boolean. Whether to allow symlinking instead of copying. When False, the output is always a hard copy. When True, the output *can* be a symlink, but there is no guarantee that a symlink is created (i.e., at the time of writing, we don't create symlinks on Windows). Set this to True if you need fast copying and your tools can handle symlinks (which most UNIX tools can). | <code>False</code> |
46
+
| <aid="copy_file-kwargs"></a>kwargs | further keyword arguments, e.g. <code>visibility</code> | none |
| <aid="run_binary-name"></a>name | A unique name for this target. | <ahref="https://bazel.build/docs/build-ref.html#name">Name</a> | required ||
24
+
| <aid="run_binary-args"></a>args | Command line arguments of the binary.<br/><br/>Subject to<code><a href="https://docs.bazel.build/versions/main/be/make-variables.html#location">$(location)</a></code> expansion. | List of strings | optional |[]|
25
+
| <aid="run_binary-env"></a>env | Environment variables of the action.<br/><br/>Subject to <code><a href="https://docs.bazel.build/versions/main/be/make-variables.html#location">$(location)</a></code> expansion. | <ahref="https://bazel.build/docs/skylark/lib/dict.html">Dictionary: String -> String</a> | optional | {} |
26
+
| <aid="run_binary-output_dir"></a>output_dir | Set to True if you want the output to be a directory. Exactly one of <code>outs</code>, <code>output_dir</code> may be used. If you output a directory, there can only be one output, which will be a directory named the same as the target. | Boolean | optional | False |
27
+
| <aid="run_binary-outs"></a>outs | Output files generated by the action.<br/><br/>These labels are available for <code>$(location)</code> expansion in <code>args</code> and <code>env</code>. | List of labels | optional ||
28
+
| <aid="run_binary-srcs"></a>srcs | Additional inputs of the action.<br/><br/>These labels are available for <code>$(location)</code> expansion in <code>args</code> and <code>env</code>. | <ahref="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional |[]|
29
+
| <aid="run_binary-tool"></a>tool | The tool to run in the action.<br/><br/>Must be the label of a *_binary rule, of a rule that generates an executable file, or of a file that can be executed as a subprocess (e.g. an .exe or .bat file on Windows or a binary with executable permission on Linux). This label is available for <code>$(location)</code> expansion in <code>args</code> and <code>env</code>. | <ahref="https://bazel.build/docs/build-ref.html#labels">Label</a> | required ||
0 commit comments