pub fn addCopyFileToSource(usf: *UpdateSourceFiles, src_file: std.Build.LazyPath, sub_path: []const u8) void usf: *UpdateSourceFilessrc_file: std.Build.LazyPathsub_path: []const u835
36
37
38
39
40
41
42
43
44
45
46pub fn addCopyFileToSource(usf: *UpdateSourceFiles, src_file: std.Build.LazyPath, sub_path: []const u8) void {
const graph = usf.step.owner.graph;
const wc = &graph.wip_configuration;
const arena = graph.arena;
usf.copies.append(arena, .{
.sub_path = wc.addString(sub_path) catch @panic("OOM"),
.src_file = src_file.dupe(graph),
}) catch @panic("OOM");
src_file.addStepDependencies(&usf.step);
}
Overwrites a path relative to the build root with the contents of another file.
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.