A rule that writes a UTF-8 encoded text file from user-specified contents.
native.genrule() is sometimes used to create a text file. The ‘write_file’ and macro does this with a simpler interface than genrule.
The rules generated by the macro do not use Bash or any other shell to write the file. Instead they use Starlark's built-in file writing action (ctx.actions.write).
load("@bazel_skylib//rules:write_file.bzl", "write_file") write_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>)
Creates a UTF-8 encoded text file.
PARAMETERS