authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-05-19 15:41:58-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-05-25 18:54:35-07:00
log58f8dcd15e04a02185f4e18dbf76c54942e05350
tree1413041c4f11019458bec1d15853f62fc48dc6c7
parent2c70c40499d260804d3e6441f6e8ff8b88378a8c

std.Build: improve documentation for UpdateSourceFiles step


2 files changed, 10 insertions(+), 5 deletions(-)

lib/std/Build.zig+10
...@@ -966,6 +966,16 @@ pub fn addWriteFiles(b: *Build) *Step.WriteFile {...@@ -966,6 +966,16 @@ pub fn addWriteFiles(b: *Build) *Step.WriteFile {
966 return Step.WriteFile.create(b);966 return Step.WriteFile.create(b);
967}967}
968968
969/// Creates a step for writing data to paths relative to the build root,
970/// mutating the project's source files.
971///
972/// This build step was designed not to be used during the normal build
973/// process, but rather as a utility run by a developer with intention to
974/// update source files, which will then be committed to version control.
975///
976/// Example use cases:
977/// * precompiling assets which are tracked by version control
978/// * snapshot testing
969pub fn addUpdateSourceFiles(b: *Build) *Step.UpdateSourceFiles {979pub fn addUpdateSourceFiles(b: *Build) *Step.UpdateSourceFiles {
970 return Step.UpdateSourceFiles.create(b);980 return Step.UpdateSourceFiles.create(b);
971}981}
lib/std/Build/Step/UpdateSourceFiles.zig-5
...@@ -1,8 +1,3 @@...@@ -1,8 +1,3 @@
1//! Writes data to paths relative to the package root, effectively mutating the
2//! package's source files. Be careful with the latter functionality; it should
3//! not be used during the normal build process, but as a utility run by a
4//! developer with intention to update source files, which will then be
5//! committed to version control.
6const UpdateSourceFiles = @This();1const UpdateSourceFiles = @This();
72
8const std = @import("std");3const std = @import("std");