Function addWatchInput [src]
Places a file dependency on the path.
Prototype
pub fn addWatchInput(step: *Step, lazy_file: Build.LazyPath) Allocator.Error!void
Parameters
step: *Step
lazy_file: Build.LazyPath
Source
pub fn addWatchInput(step: *Step, lazy_file: Build.LazyPath) Allocator.Error!void {
switch (lazy_file) {
.src_path => |src_path| try addWatchInputFromBuilder(step, src_path.owner, src_path.sub_path),
.dependency => |d| try addWatchInputFromBuilder(step, d.dependency.builder, d.sub_path),
.cwd_relative => |path_string| {
try addWatchInputFromPath(step, .{
.root_dir = .{
.path = null,
.handle = std.fs.cwd(),
},
.sub_path = std.fs.path.dirname(path_string) orelse "",
}, std.fs.path.basename(path_string));
},
// Nothing to watch because this dependency edge is modeled instead via `dependants`.
.generated => {},
}
}