Documentation for @bazel_lib@v3.2.0 — View source
Function: copy_file_to_bin_action
Factory function that creates an action to copy a file to the output tree.
File are copied to the same workspace-relative path. The resulting files is
returned.
If the file passed in is already in the output tree is then it is returned
without a copy action.
To use copy_file_to_bin_action in your own rules, you need to include the toolchains it uses
in your rule definition. For example:
Parameters
The rule context.
The file to copy.
Function: copy_files_to_bin_actions
Factory function that creates actions to copy files to the output tree.
Files are copied to the same workspace-relative path. The resulting list of
files is returned.
If a file passed in is already in the output tree is then it is added
directly to the result without a copy action.
Parameters
The rule context.
List of File objects.
Function: copy_to_bin
Copies a source file to output tree at the same workspace-relative path.
e.g. <execroot>/path/to/file -> <execroot>/bazel-out/<platform>/bin/path/to/file
If a file passed in is already in the output tree is then it is added directly to the
DefaultInfo provided by the rule without a copy.
This is useful to populate the output folder with all files needed at runtime, even
those which aren’t outputs of a Bazel rule.
This way you can run a binary in the output folder (execroot or runfiles_root)
without that program needing to rely on a runfiles helper library or be aware that
files are divided between the source tree and the output tree.
Parameters
Name of the rule.
A list of labels. File(s) to copy.
further keyword arguments, e.g.
visibility
