public string Build(Action <FileActionProgress>?monitor = null, CancellationToken token = default) { _specFile.VerifyNotEmpty("Specification file not read"); _specFileBase.VerifyNotEmpty("Specification file not read"); _buildFolder.VerifyNotEmpty("Deployment folder not specified"); _objFolder.VerifyNotEmpty("Obj folder not specified"); ArticleSpec = new ArticleSpecFile(_specFile).Read(); ArticleSpec .VerifyNotNull("Option is required") .Verify(); CopyTo[] files = GetFiles() .Append(WriteManifest()) .ToArray(); string zipFilePath = Path.Combine(_buildFolder, ArticleSpec.PackageFile); Directory.CreateDirectory(Path.GetDirectoryName(zipFilePath) !); new ZipFile(zipFilePath).CompressFiles(token, monitor, files); return(zipFilePath); }
public static void Verify(this ArticleSpec subject) { subject.VerifyNotNull(nameof(subject)); subject.PackageFile.VerifyNotEmpty($"{nameof(subject.PackageFile)} is required"); subject.Manifest.VerifyNotNull($"{nameof(subject.Manifest)} is required"); subject.Copy .VerifyNotNull($"{nameof(subject.Copy)} is required") .VerifyAssert(x => x.Count > 0, $"{nameof(subject.Copy)} has is empty"); }