DoxigAlpha

addCopyDirectory

Copy files matching the specified exclude/include patterns to the specified subdirectory relative to this step's generated directory. The returned value is a lazy path to the generated subdirectory.

Function parameters

Parameters

#
write_file:*WriteFile
source:std.Build.LazyPath
sub_path:[]const u8
options:Directory.Options

Type definitions in this namespace

Types

#

Functions in this namespace

Functions

#
addCopyFile
Place the file into the generated directory within the local cache,
addCopyDirectory
Copy files matching the specified exclude/include patterns to the specified subdirectory
getDirectory
Returns a `LazyPath` representing the base directory that contains all the

= .write_file

Values

#
base_id
= .write_file

Source

Implementation

#
pub fn addCopyDirectory(
    write_file: *WriteFile,
    source: std.Build.LazyPath,
    sub_path: []const u8,
    options: Directory.Options,
) std.Build.LazyPath {
    const b = write_file.step.owner;
    const gpa = b.allocator;
    const dir = Directory{
        .source = source.dupe(b),
        .sub_path = b.dupePath(sub_path),
        .options = options.dupe(b),
    };
    write_file.directories.append(gpa, dir) catch @panic("OOM");

    write_file.maybeUpdateName();
    source.addStepDependencies(&write_file.step);
    return .{
        .generated = .{
            .file = &write_file.generated_directory,
            .sub_path = dir.sub_path,
        },
    };
}