Nuke.Cola
Loading...
Searching...
No Matches
Nuke.Cola.FolderComposition.FolderComposition Class Reference

Static Public Member Functions

static List< ImportedItem > ImportFolders (this INukeBuild self, ImportOptions? options, params ImportFolderItem[] imports)
 Convenience method for specifying multiple folder from/to pairs for ImportFolder
 
static List< ImportedItem > ImportFolders (this INukeBuild self, params ImportFolderItem[] imports)
 
static List< ImportedItem > ImportFolder (this INukeBuild self, ImportFolderItem import, ImportOptions? options=null)
 There are cases when one project needs to compose from one pre-existing rigid folder structure of one dependency to another rigid folder structure of the current project. For scenarios like this Nuke.Cola provides this extension method which will copy/link the target folder and its contents according to some instructions expressed by either an export.yml file in the imported folder or provided explicitly from ImportFolderItem.
 
static IEnumerable< ImportedItem > WithFilesExpanded (this IEnumerable< ImportedItem > importedItems, string pattern="*", int depth=40)
 The result of ImportFolder only contain directory references if they were imported explicitly as a directory as a singular item (so not via file globbing). However there are cases in which all affected files should be minded. WithFilesExpanded converts the result of ImportFolder into a proper flat list of files only. It can work with pretended data as well, maintaining correct relations between From / To members.
 

Static Private Member Functions

static string ProcessSuffix (this string target, ImportFolderSuffixes? suffixes, string leads="_.:")
 
static AbsolutePath ProcessSuffixPath (this AbsolutePath target, ImportFolderSuffixes? suffixes, AbsolutePath? until=null, string leads="_.:")
 
static void ProcessSuffixContent (this AbsolutePath target, ImportFolderSuffixes? suffixes, string leads="_.:")
 

Detailed Description

Definition at line 125 of file FolderComposition.cs.

Member Function Documentation

◆ ImportFolder()

static List< ImportedItem > Nuke.Cola.FolderComposition.FolderComposition.ImportFolder ( this INukeBuild self,
ImportFolderItem import,
ImportOptions? options = null )
static

There are cases when one project needs to compose from one pre-existing rigid folder structure of one dependency to another rigid folder structure of the current project. For scenarios like this Nuke.Cola provides this extension method which will copy/link the target folder and its contents according to some instructions expressed by either an export.yml file in the imported folder or provided explicitly from ImportFolderItem.

Parameters
selfFor easier access this is an extension method
importThe folder import from / to pair. Optionally can specify an export manifest. ImportFolderItem
optionsWhen and by default true, a subfolder is created for the import, or when false, the folder is composited with the given target folder directly.

Definition at line 223 of file FolderComposition.cs.

◆ ImportFolders() [1/2]

static List< ImportedItem > Nuke.Cola.FolderComposition.FolderComposition.ImportFolders ( this INukeBuild self,
ImportOptions? options,
params ImportFolderItem[] imports )
static

Convenience method for specifying multiple folder from/to pairs for ImportFolder

, new ImportOptions(Suffixes: "Test")
, (root / "Unassuming", target)
, (root / "FolderOnly_Origin", target)
, (root / "WithManifest" / "Both_Origin", target / "WithManifest")
, (root / "WithManifest" / "Copy_Origin", target / "WithManifest")
, (root / "WithManifest" / "Link_Origin", target / "WithManifest")
, (root / "ScriptControlled", target, new ExportManifest
{
Link = {
new() { Directory = "Private/SharedSubfolder"},
new() { Directory = "Public/SharedSubfolder"},
},
Copy = {
new() {
File = "**&zwj;/*_Origin.*",
ProcessContent = true
}
}
})
);
Controls how a folder should be exported for composition. It is meant to be used with export....
static List< ImportedItem > ImportFolders(this INukeBuild self, ImportOptions? options, params ImportFolderItem[] imports)
Convenience method for specifying multiple folder from/to pairs for ImportFolder
record class ImportOptions(bool UseSubfolder=true, bool Pretend=false, bool CopyByDefault=false, bool ForceCopyLinks=false, bool ImplicitImport=false, ImportFolderSuffixes? Suffixes=null, IEnumerable< ExportManifest >? AddToMain=null, IEnumerable< ExportManifest >? AddToAll=null)
Further options for ImportFolder.
Parameters
selfFor easier access this is an extension method
optionsWhen and by default true, a subfolder is created for the import, or when false, the folder is composited with the given target folder directly.
importsThe folder import from / to pair. Optionally can specify an export manifest. ImportFolderItem

◆ ImportFolders() [2/2]

static List< ImportedItem > Nuke.Cola.FolderComposition.FolderComposition.ImportFolders ( this INukeBuild self,
params ImportFolderItem[] imports )
static

◆ ProcessSuffix()

static string Nuke.Cola.FolderComposition.FolderComposition.ProcessSuffix ( this string target,
ImportFolderSuffixes? suffixes,
string leads = "_.:" )
staticprivate

Definition at line 127 of file FolderComposition.cs.

◆ ProcessSuffixContent()

static void Nuke.Cola.FolderComposition.FolderComposition.ProcessSuffixContent ( this AbsolutePath target,
ImportFolderSuffixes? suffixes,
string leads = "_.:" )
staticprivate

Definition at line 154 of file FolderComposition.cs.

◆ ProcessSuffixPath()

static AbsolutePath Nuke.Cola.FolderComposition.FolderComposition.ProcessSuffixPath ( this AbsolutePath target,
ImportFolderSuffixes? suffixes,
AbsolutePath? until = null,
string leads = "_.:" )
staticprivate

Definition at line 141 of file FolderComposition.cs.

◆ WithFilesExpanded()

static IEnumerable< ImportedItem > Nuke.Cola.FolderComposition.FolderComposition.WithFilesExpanded ( this IEnumerable< ImportedItem > importedItems,
string pattern = "*",
int depth = 40 )
static

The result of ImportFolder only contain directory references if they were imported explicitly as a directory as a singular item (so not via file globbing). However there are cases in which all affected files should be minded. WithFilesExpanded converts the result of ImportFolder into a proper flat list of files only. It can work with pretended data as well, maintaining correct relations between From / To members.

Parameters
importedItems
pattern
depth
Returns
A flat list of all files affected even in directories referenced as singular items.

The documentation for this class was generated from the following file: