commit 58f8dcd15e04a02185f4e18dbf76c54942e05350 (tree)
parent 2c70c40499d260804d3e6441f6e8ff8b88378a8c
Author: Andrew Kelley <andrew@ziglang.org>
Date: Tue, 19 May 2026 15:41:58 -0700
std.Build: improve documentation for UpdateSourceFiles step
Diffstat:
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/lib/std/Build.zig b/lib/std/Build.zig
@@ -966,6 +966,16 @@ pub fn addWriteFiles(b: *Build) *Step.WriteFile {
return Step.WriteFile.create(b);
}
+/// Creates a step for writing data to paths relative to the build root,
+/// mutating the project's source files.
+///
+/// This build step was designed not to be used during the normal build
+/// process, but rather as a utility run by a developer with intention to
+/// update source files, which will then be committed to version control.
+///
+/// Example use cases:
+/// * precompiling assets which are tracked by version control
+/// * snapshot testing
pub fn addUpdateSourceFiles(b: *Build) *Step.UpdateSourceFiles {
return Step.UpdateSourceFiles.create(b);
}
diff --git a/lib/std/Build/Step/UpdateSourceFiles.zig b/lib/std/Build/Step/UpdateSourceFiles.zig
@@ -1,8 +1,3 @@
-//! Writes 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.
const UpdateSourceFiles = @This();
const std = @import("std");