WriteFile is primarily used to create a directory in an appropriate location inside the local cache which has a set of files that have either been generated during the build, or are copied from the source package.
However, this step has an additional capability of writing data to paths relative to the package root, effectively mutating the package’s source files. Be careful with the latter functionality; it should not be used during the normal build process, but as a utility run by a developer with intention to update source files, which will then be committed to version control.
Fields
step: Step,
files: field_call,
The elements here are pointers because we need stable pointers for the GeneratedFile field.
output_source_files: field_call,
generated_directory: std.Build.GeneratedFile,
Functions
fn add(wf: *WriteFile, sub_path: []const u8, bytes: []const u8) std.Build.LazyPath
No documentation provided.
fn addBytesToSource(wf: *WriteFile, bytes: []const u8, sub_path: []const u8) void
A path relative to the package root. Be careful with this because it updates so…
A path relative to the package root. Be careful with this because it updates source files. This should not be used as part of the normal build process, but as a utility occasionally run by a developer with intent to modify source files and then commit those changes to version control.
fn addCopyFile(wf: *WriteFile, source: std.Build.LazyPath, sub_path: []const u8) std.Build.LazyPath
Place the file into the generated directory within the local cache, along with …
Place the file into the generated directory within the local cache, along with all the rest of the files added to this step. The parameter here is the destination path relative to the local cache directory associated with this WriteFile. It may be a basename, or it may include sub-directories, in which case this step will ensure the required sub-path exists. This is the option expected to be used most commonly with
addCopyFile
.fn addCopyFileToSource(wf: *WriteFile, source: std.Build.LazyPath, sub_path: []const u8) void
A path relative to the package root. Be careful with this because it updates so…
A path relative to the package root. Be careful with this because it updates source files. This should not be used as part of the normal build process, but as a utility occasionally run by a developer with intent to modify source files and then commit those changes to version control.