DoxigAlpha

create

Function parameters

Parameters

#
owner:*std.Build
dest_rel_path:[]const u8

Functions in this namespace

Functions

#

= .install_file

Values

#
base_id
= .install_file

Source

Implementation

#
pub fn create(
    owner: *std.Build,
    source: LazyPath,
    dir: InstallDir,
    dest_rel_path: []const u8,
) *InstallFile {
    assert(dest_rel_path.len != 0);
    const install_file = owner.allocator.create(InstallFile) catch @panic("OOM");
    install_file.* = .{
        .step = Step.init(.{
            .id = base_id,
            .name = owner.fmt("install {s} to {s}", .{ source.getDisplayName(), dest_rel_path }),
            .owner = owner,
            .makeFn = make,
        }),
        .source = source.dupe(owner),
        .dir = dir.dupe(owner),
        .dest_rel_path = owner.dupePath(dest_rel_path),
    };
    source.addStepDependencies(&install_file.step);
    return install_file;
}