Meziantou.Framework.DependencyScanning namespace

Classes

NameDescription
DependencyRepresents a dependency discovered during scanning, including its name, version, type, and location information.
DependencyScannerProvides the base class for scanning source code files to discover dependencies across multiple package ecosystems and formats.
// Scan a directory for all dependencies
var dependencies = await DependencyScanner.ScanDirectoryAsync(
    "C:\\MyProject",
    options: null,
    cancellationToken);

foreach (var dependency in dependencies)
{
    Console.WriteLine($"{dependency.Type}: {dependency.Name}@{dependency.Version}");
}
DependencyScannerExceptionRepresents errors that occur during dependency scanning operations.
LocationRepresents the location of a dependency value in a source file, providing the ability to update the value in place.
LocationExtensionsProvides extension methods for ordering dependencies by their location in source files.
ScannerOptionsProvides configuration options for dependency scanning operations.
var options = new ScannerOptions
{
    DegreeOfParallelism = 8,
    RecurseSubdirectories = true,
    IncludedDependencyTypes = [DependencyType.NuGet, DependencyType.Npm],
};
var dependencies = await DependencyScanner.ScanDirectoryAsync("C:\\MyProject", options, cancellationToken);

Structs

NameDescription
CandidateFileContextProvides context information about a candidate file during the scanning process.
ScanFileContextProvides context information and methods for scanning a file and reporting discovered dependencies.

Interfaces

NameDescription
IFileSystemProvides an abstraction for file system operations, enabling testability and custom file access implementations.
ILocationLineInfo

Enums

NameDescription
DependencyTypeSpecifies the type of dependency detected during scanning.

Delegates

NameDescription
DependencyFoundRepresents the callback method that is invoked when a dependency is found during scanning.
FileScanFailedRepresents the callback method that is invoked when a file cannot be scanned.
FileSystemEntryPredicateRepresents a predicate for filtering file system entries during directory enumeration.