From 79d824cfb0e0cc9ff4fab0e0c546a83c0edaae1c Mon Sep 17 00:00:00 2001 From: vnugent Date: Tue, 7 May 2024 17:01:22 -0400 Subject: initial commit --- src/Model/IModuleFileManager.cs | 62 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 src/Model/IModuleFileManager.cs (limited to 'src/Model/IModuleFileManager.cs') diff --git a/src/Model/IModuleFileManager.cs b/src/Model/IModuleFileManager.cs new file mode 100644 index 0000000..cf1a325 --- /dev/null +++ b/src/Model/IModuleFileManager.cs @@ -0,0 +1,62 @@ +using System.IO; +using System.Threading.Tasks; + +namespace VNLib.Tools.Build.Executor.Model +{ + public enum ModuleFileType + { + None, + Catalog, + GitHistory, + Checksum, + LatestHash, + VersionHistory, + Archive + } + + public interface IModuleFileManager + { + /// + /// Writes the file to the module output directory + /// + /// The to write + /// The file data to write + /// A task that resolves when the file has been written + Task WriteFileAsync(ModuleFileType type, byte[] fileData); + + /// + /// Writes the checksum file to the sum's output directory for the given project + /// + /// The project to write the sum file data for + /// + /// + Task WriteChecksumAsync(IProject project, byte[] fileData); + + /// + /// Attemts to read the checksum file data for the given project + /// + /// The project to get the sum data for + /// The file contents of the sum file, or null if the file does not exist + Task ReadCheckSumAsync(IProject project); + + /// + /// The module's output directory + /// + string OutputDir { get; } + + /// + /// Copies the given file to the project's output directory + /// + /// + /// + /// + Task CopyArtifactToOutputAsync(IProject project, FileInfo file); + + /// + /// Gets the output directory for the given project + /// + /// The project to get the artifact output of + /// A object describing the output dir + DirectoryInfo GetArtifactOutputDir(IProject project); + } +} \ No newline at end of file -- cgit