File
Aliases
returns an IEnumerable
of FilePath
's that match multiple glob patterns
IEnumerable<FilePath> filePaths = GetFiles("**/*.sln", "**/*.csproj");
moves a file
MoveFiles("/from/source.txt", "/to/destination.txt");
moves a list of files to a folder
var source = new[] { new FilePath("/from/one.txt"), new FilePath("/from/two.txt") };
MoveFiles(source, new Directory("/to");
// /to/one.txt
// /to/two.txt 🐦
The FilePath
and the build configuration will get the output files (dll or exe) and return them as an IEnumerable
of FilePath
For a solution
// Solution output dll/exe's FilePath[] for 'Release' configuration
IEnumerable<FilePath> filePaths = GetOutputAssemblies(new FilePath("test.sln"), "Release");
For a project
// Project output dll/exe as FilePath[] for 'Custom' configuration
IEnumerable<FilePath> filePaths = GetOutputAssemblies(new FilePath("test.csproj"), "Custom");
The alias expects a valid .sln
or a csproj
file.
// throws ArgumentException("not a project or solution file")
GetOutputAssemblies(new FilePath("test.cs"), "Debug");
Like GetOutputAssemblies
but works for .sln
files only.
// returns solution output dll/exe's FilePath[] for 'Release' configuration
IEnumerable<FilePath> filePaths = GetSolutionAssemblies(new FilePath("test.sln"), "Release");
// throws ArgumentException("not a solution file")
IEnumerable<FilePath> filePaths = GetSolutionAssemblies(new FilePath("test.csproj"), "Debug");
Like GetOutputAssemblies
but works for .csproj
files only.
// returns solution output dll/exe FilePath for 'Release' configuration
IEnumerable<FilePath> filePaths = GetProjectAssembly(new FilePath("test.csproj"), "Release");
// throws ArgumentException("not a project file")
IEnumerable<FilePath> filePaths = GetProjectAssembly(new FilePath("test.sln"), "Debug");
Locates files with the same name in the same directory, but different extensions.
The
.pdb
to your.dll
as it were.
// Alias : GetMatchingFiles(FilePath file)
// /output/file.dll
// /output/file.xml
// /output/file.pdb
// output/another.dll
// matchingFiles.Length = 2
IEnumerable<FilePath> matchingFiles = GetMatchingFiles(new FilePath("/output/file.dll"));
matchingFiles[0]; // /output/file.xml
matchingFiles[1]; // /output/file.pdb
Extensions
Extension methods can be called on FilePath
objects
Check if the file is a solution
new FilePath("test.sln").IsSolution(); // true
Check if the file is a project
new FilePath("test.csproj").IsProject(); // true;
new FilePath("test.fsproj").IsProject(); // true;