From 83cf11c626329ea4148feee1385745baff34ec32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pereira?= Date: Mon, 15 Nov 2021 11:03:59 +0000 Subject: [PATCH] chore: assemble command #53 --- cmf-cli/CliMessages.Designer.cs | 29 ++- cmf-cli/CliMessages.resx | 11 + cmf-cli/Commands/assemble/AssembleCommand.cs | 255 ++++++++++--------- cmf-cli/Constants/CliConstants.cs | 24 +- cmf-cli/Objects/CmfPackage.cs | 32 +-- cmf-cli/Utilities/CliException.cs | 13 +- docs/cmf/Cmf_Common_Cli.md | 27 ++ docs/cmf/Cmf_Common_Cli_Commands.md | 135 +++++----- docs/cmf/Cmf_Common_Cli_Constants.md | 9 + docs/cmf/Cmf_Common_Cli_Handlers.md | 26 +- docs/cmf/Cmf_Common_Cli_Objects.md | 79 +++--- docs/cmf/Cmf_Common_Cli_Utilities.md | 69 +++-- docs/cmf/cmf.xml | 51 ++-- 13 files changed, 451 insertions(+), 309 deletions(-) diff --git a/cmf-cli/CliMessages.Designer.cs b/cmf-cli/CliMessages.Designer.cs index ddd75f4e..9307a547 100644 --- a/cmf-cli/CliMessages.Designer.cs +++ b/cmf-cli/CliMessages.Designer.cs @@ -19,7 +19,7 @@ namespace Cmf.Common.Cli { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class CliMessages { @@ -69,6 +69,15 @@ internal static string ContentToPackNotFound { } } + /// + /// Looks up a localized string similar to Get Package {0}.{1}.... + /// + internal static string GetPackage { + get { + return ResourceManager.GetString("GetPackage", resourceCulture); + } + } + /// /// Looks up a localized string similar to It was not possible to read the manifest file.. /// @@ -123,6 +132,15 @@ internal static string MissingMandatoryPropertyInFile { } } + /// + /// Looks up a localized string similar to This is not a root package. + /// + internal static string NotARootPackage { + get { + return ResourceManager.GetString("NotARootPackage", resourceCulture); + } + } + /// /// Looks up a localized string similar to {0} not found!. /// @@ -132,6 +150,15 @@ internal static string NotFound { } } + /// + /// Looks up a localized string similar to Package {0}.{1} has no test packages. + /// + internal static string PackageHasNoTestPackages { + get { + return ResourceManager.GetString("PackageHasNoTestPackages", resourceCulture); + } + } + /// /// Looks up a localized string similar to Cannot find package root. Are you in a valid package directory?. /// diff --git a/cmf-cli/CliMessages.resx b/cmf-cli/CliMessages.resx index 5887431d..4b3021a7 100644 --- a/cmf-cli/CliMessages.resx +++ b/cmf-cli/CliMessages.resx @@ -121,6 +121,10 @@ Nothing was found on ContentToPack Sources of {0}.{1} 0 - Package Id; 1 - Package Version + + Get Package {0}.{1}... + 0 - Id; 1 - Version + It was not possible to read the manifest file. @@ -144,10 +148,17 @@ Missing mandatory property {0} in file {1} 0 - Property name; 1 - File name + + This is not a root package + {0} not found! 0 - Name + + Package {0}.{1} has no test packages + 0 - Id; 1 - Version + Cannot find package root. Are you in a valid package directory? diff --git a/cmf-cli/Commands/assemble/AssembleCommand.cs b/cmf-cli/Commands/assemble/AssembleCommand.cs index 05b429dc..a146a193 100644 --- a/cmf-cli/Commands/assemble/AssembleCommand.cs +++ b/cmf-cli/Commands/assemble/AssembleCommand.cs @@ -2,6 +2,7 @@ using Cmf.Common.Cli.Constants; using Cmf.Common.Cli.Objects; using Cmf.Common.Cli.Utilities; +using Newtonsoft.Json; using System; using System.Collections.Generic; using System.CommandLine; @@ -12,100 +13,23 @@ namespace Cmf.Common.Cli.Commands { /// - /// This command will be responsible for assemble a package based on a given cmfpackage and respective dependencies + /// This command will be responsible for assembling a package based on a given cmfpackage and respective dependencies /// /// [CmfCommand("assemble")] public class AssembleCommand : BaseCommand { - #region Private Methods - - private void AssembleTestPackages(IDirectoryInfo outputDir, Uri[] repos, CmfPackage cmfPackage, DependencyCollection loadedDependencies = null) - { - IDirectoryInfo testOutputDir = this.fileSystem.DirectoryInfo.FromDirectoryName(outputDir + "/Tests"); - - if (!cmfPackage.TestPackages.HasAny()) - { - // TO-DO: Missing resource message - // No dependencies found for package - Log.Information($"Package {cmfPackage.PackageId}.{cmfPackage.Version} has no test packages"); - } - else - { - foreach (Dependency testPackage in cmfPackage.TestPackages) - { - if (!loadedDependencies.Contains(testPackage)) - { - // TO-DO: Missing resource message - Log.Information($"Get Test Package {testPackage.Id}.{testPackage.Version}..."); - loadedDependencies.Add(testPackage); - - AssemblePackage(testOutputDir, repos, testPackage.CmfPackage); - } - } - } - } + #region Private Properties /// - /// Publish Dependencies from one package. recursive operation + /// Packages names and Uri to saved in a file in the end of the command execution /// - /// Destination for the dependencies package and also used for the current package - /// The repos. - /// The CMF package. - /// The loaded dependencies. - private void AssembleDependencies(IDirectoryInfo outputDir, Uri[] repos, CmfPackage cmfPackage, DependencyCollection loadedDependencies = null) - { - if(cmfPackage.Dependencies.HasAny()) - { - // TO-DO: Missing comments - loadedDependencies ??= new(); - foreach (Dependency localDependency in cmfPackage.Dependencies) - { - if (!loadedDependencies.Contains(localDependency)) - { - Log.Information($"Get Dependency Package {localDependency.Id}.{localDependency.Version}..."); - loadedDependencies.Add(localDependency); - AssemblePackage(outputDir, repos, localDependency.CmfPackage); - if (localDependency.CmfPackage.Dependencies.HasAny()) - { - AssembleDependencies(outputDir, repos, localDependency.CmfPackage, loadedDependencies); - } - - } - } - } - } - - /// - /// Publish a package to the output directory - /// - /// Destiny for the package - /// The repos. - /// The CMF package. - /// - /// True if package was coppied - /// - /// - private void AssemblePackage(IDirectoryInfo outputDir, Uri[] repos, CmfPackage cmfPackage) - { - IDirectoryInfo[] repoDirectories = repos?.Select(r => fileSystem.DirectoryInfo.FromDirectoryName(r.OriginalString)).ToArray(); - - if (cmfPackage == null || (cmfPackage!= null && cmfPackage.Uri == null)) - { - cmfPackage = CmfPackage.LoadFromRepo(repoDirectories, cmfPackage.PackageId, cmfPackage.Version); - } - - string destinationFile = $"{outputDir.FullName}/{cmfPackage.Uri.Segments.Last()}"; - if (fileSystem.File.Exists(destinationFile)) - { - fileSystem.File.Delete(destinationFile); - } - - fileSystem.FileInfo.FromFileName(cmfPackage.Uri.LocalPath).CopyTo(destinationFile); - } + private Dictionary PackagesLocation = new(); #endregion + #region Public Methods + /// /// Configure command /// @@ -126,16 +50,20 @@ public override void Configure(Command cmd) isDefault: true, description: "Output directory for assembled package")); + cmd.AddOption(new Option( + aliases: new string[] { "--cirepo" }, + description: "Repository where Continuous Integration packages are located (url or folder)")); + cmd.AddOption(new Option( aliases: new string[] { "-r", "--repos", "--repo" }, - description: "Repository or repositories where dependencies are located (url or folder)")); + description: "Repository or repositories where published dependencies are located (url or folder)")); cmd.AddOption(new Option( aliases: new string[] { "--includeTestPackages" }, description: "Include test packages on assemble")); // Add the handler - cmd.Handler = CommandHandler.Create(Execute); + cmd.Handler = CommandHandler.Create(Execute); } /// @@ -143,43 +71,41 @@ public override void Configure(Command cmd) /// /// The working dir. /// The output dir. + /// /// The repo. /// True to publish test packages /// - public void Execute(IDirectoryInfo workingDir, IDirectoryInfo outputDir, Uri[] repos, bool includeTestPackages) + public void Execute(IDirectoryInfo workingDir, IDirectoryInfo outputDir, Uri ciRepo, Uri[] repos, bool includeTestPackages) { IFileInfo cmfpackageFile = fileSystem.FileInfo.FromFileName($"{workingDir}/{CliConstants.CmfPackageFileName}"); - // To avoid memory references the CmfPackage needs to be loaded twice - // One - get the dependencies from the same working directory where the package is located CmfPackage cmfPackage = CmfPackage.Load(cmfpackageFile); - cmfPackage.LoadDependencies(null, true); if (cmfPackage.PackageType != Enums.PackageType.Root) { - // TO-DO: Throw error? + throw new CliException(CliMessages.NotARootPackage); } - // Two - get the dependencies located in the input repositories - CmfPackage repoCmfPackage = CmfPackage.Load(cmfpackageFile); - repoCmfPackage.LoadDependencies(repos, true); + // The method LoadDependencies will return the dependency from the first repo in the list + // We need to force the CI Repo to be the last to be checked, to make sure that we first check the "release repositories" + List remoteRepos = new(); + remoteRepos.AddRange(repos); + remoteRepos.Add(ciRepo); + + cmfPackage.LoadDependencies(remoteRepos, true); #region Missing Dependencies Handling - // If a dependency is not found in the working directory or in the repository and error should be throw + // If a dependency is not found in any repository an error should be throw List missingPackages = new(); - foreach (Dependency missingLocalDep in cmfPackage.Dependencies.Where(x => x.IsMissing)) + foreach (Dependency dependency in cmfPackage.Dependencies.Where(x => x.IsMissing)) { - Dependency dependencyFromRepo = repoCmfPackage.Dependencies.Get(missingLocalDep); - if (dependencyFromRepo.IsMissing) - { - missingPackages.Add($"{dependencyFromRepo.Id}@{dependencyFromRepo.Version}"); - } + missingPackages.Add($"{dependency.Id}@{dependency.Version}"); } if (missingPackages.HasAny()) { - throw new CliException(string.Format(CliMessages.SomePackagesNotFound, string.Join(",", missingPackages))); + throw new CliException(CliMessages.SomePackagesNotFound, string.Join(",", missingPackages)); } #endregion @@ -187,15 +113,10 @@ public void Execute(IDirectoryInfo workingDir, IDirectoryInfo outputDir, Uri[] r #region Output Directories Handling outputDir = FileSystemUtilities.GetOutputDir(cmfPackage, outputDir, force: true); - if (outputDir == null) - { - return; - } if (includeTestPackages) { - // TO-DO: missing Tests constant - IDirectoryInfo outputTestDir = this.fileSystem.DirectoryInfo.FromDirectoryName(outputDir + "/Tests"); + IDirectoryInfo outputTestDir = this.fileSystem.DirectoryInfo.FromDirectoryName(outputDir + CliConstants.FolderTests); if (!outputTestDir.Exists) { outputTestDir.Create(); @@ -206,21 +127,123 @@ public void Execute(IDirectoryInfo workingDir, IDirectoryInfo outputDir, Uri[] r try { - // Assemble scope package - AssemblePackage(outputDir, repos, repoCmfPackage); + // Assemble current package + AssemblePackage(outputDir, remoteRepos, cmfPackage); + // Assemble Dependencies - AssembleDependencies(outputDir, repos, repoCmfPackage); + AssembleDependencies(outputDir, ciRepo, remoteRepos, cmfPackage); - // Assemble Tests - if(includeTestPackages) - { - AssembleTestPackages(outputDir, repos, repoCmfPackage); - } + // Save Dependencies File + // This file will be needed for CMF Internal Releases to know where the external dependencies are located + string depedenciesFilePath = this.fileSystem.Path.Join(workingDir.FullName, CliConstants.FileDependencies); + fileSystem.File.WriteAllText(depedenciesFilePath, JsonConvert.SerializeObject(PackagesLocation)); } catch (Exception e) { throw new CliException(e.Message); } } + + #endregion + + #region Private Methods + + private void AssembleTestPackages(IDirectoryInfo outputDir, IEnumerable repos, CmfPackage cmfPackage, DependencyCollection loadedDependencies = null) + { + if (!cmfPackage.TestPackages.HasAny()) + { + // No test packages found for package + Log.Information(string.Format(CliMessages.PackageHasNoTestPackages, cmfPackage.PackageId, cmfPackage.Version)); + } + else + { + IDirectoryInfo testOutputDir = this.fileSystem.DirectoryInfo.FromDirectoryName(outputDir + "/Tests"); + + foreach (Dependency testPackage in cmfPackage.TestPackages) + { + if (!loadedDependencies.Contains(testPackage)) + { + Log.Information(string.Format(CliMessages.GetPackage, testPackage.Id, testPackage.Version)); + loadedDependencies.Add(testPackage); + + AssemblePackage(testOutputDir, repos, testPackage.CmfPackage); + } + } + } + } + + /// + /// Publish Dependencies from one package. recursive operation + /// + /// Destination for the dependencies package and also used for the current package + /// + /// The repos. + /// The CMF package. + /// The loaded dependencies. + private void AssembleDependencies(IDirectoryInfo outputDir, Uri ciRepo, IEnumerable repos, CmfPackage cmfPackage, DependencyCollection assembledDependencies = null) + { + if (cmfPackage.Dependencies.HasAny()) + { + assembledDependencies ??= new(); + + foreach (Dependency dependency in cmfPackage.Dependencies) + { + string dependencyPath = fileSystem.Path.GetDirectoryName(dependency.CmfPackage.Uri.OriginalString); + + // To avoid assembling the same dependency twice + // Only assemble dependencies from the CI Repository + if (!assembledDependencies.Contains(dependency) && + string.Equals(ciRepo.OriginalString, dependencyPath)) + { + Log.Information(string.Format(CliMessages.GetPackage, dependency.Id, dependency.Version)); + + assembledDependencies.Add(dependency); + AssemblePackage(outputDir, repos, dependency.CmfPackage); + } + // Save all external dependencies and locations in a dictionary + else + { + PackagesLocation.Add($"{dependency.Id}@{dependency.Version}", dependency.CmfPackage.Uri.OriginalString); + } + + AssembleDependencies(outputDir, ciRepo, repos, dependency.CmfPackage, assembledDependencies); + } + } + } + + /// + /// Publish a package to the output directory + /// + /// Destiny for the package + /// The repos. + /// The CMF package. + /// + /// + private void AssemblePackage(IDirectoryInfo outputDir, IEnumerable repos, CmfPackage cmfPackage, bool includeTestPackages = false) + { + IDirectoryInfo[] repoDirectories = repos?.Select(r => fileSystem.DirectoryInfo.FromDirectoryName(r.OriginalString)).ToArray(); + + // Load package from repo if is not loaded yet + if (cmfPackage == null || (cmfPackage != null && cmfPackage.Uri == null)) + { + cmfPackage = CmfPackage.LoadFromRepo(repoDirectories, cmfPackage.PackageId, cmfPackage.Version); + } + + string destinationFile = $"{outputDir.FullName}/{cmfPackage.Uri.Segments.Last()}"; + if (fileSystem.File.Exists(destinationFile)) + { + fileSystem.File.Delete(destinationFile); + } + + fileSystem.FileInfo.FromFileName(cmfPackage.Uri.LocalPath).CopyTo(destinationFile); + + // Assemble Tests + if (includeTestPackages) + { + AssembleTestPackages(outputDir, repos, cmfPackage); + } + } + + #endregion } -} \ No newline at end of file +} diff --git a/cmf-cli/Constants/CliConstants.cs b/cmf-cli/Constants/CliConstants.cs index bd838f6e..cbbfbbf8 100644 --- a/cmf-cli/Constants/CliConstants.cs +++ b/cmf-cli/Constants/CliConstants.cs @@ -17,6 +17,11 @@ public static class CliConstants /// public const string FolderInstallDependencies = "installDependencies"; + /// + /// Tests Folder + /// + public const string FolderTests = "/Tests"; + #endregion #region Files @@ -49,12 +54,12 @@ public static class CliConstants /// /// The lb os file location /// - public const string LBOsFileLocation = "Libs/LBOs/NetStandard/Cmf.LightBusinessObjects.dll"; - + public const string LBOsFileLocation = "Libs/LBOs/NetStandard/Cmf.LightBusinessObjects.dll"; + /// - /// Driver keyword for IoT Packages - /// - public const string Driver = "driver"; + /// Dependencies File Name + /// + public const string FileDependencies = "dependencies.json"; #endregion @@ -68,7 +73,12 @@ public static class CliConstants /// /// The deployment metadata dependency /// - public const string DeploymentMetadataDependency = "Cmf.Custom.DeploymentMetadata"; + public const string DeploymentMetadataDependency = "Cmf.Custom.DeploymentMetadata"; + + /// + /// Driver keyword for IoT Packages + /// + public const string Driver = "driver"; #endregion @@ -116,4 +126,4 @@ public static class CliConstants #endregion } -} \ No newline at end of file +} diff --git a/cmf-cli/Objects/CmfPackage.cs b/cmf-cli/Objects/CmfPackage.cs index d8b9a841..622c9fb2 100644 --- a/cmf-cli/Objects/CmfPackage.cs +++ b/cmf-cli/Objects/CmfPackage.cs @@ -255,15 +255,6 @@ private void ValidatePackage() } } - /// - /// Shallows the copy. - /// - /// - private CmfPackage ShallowCopy() - { - return (CmfPackage)MemberwiseClone(); - } - #endregion #region Constructors @@ -454,9 +445,9 @@ public void SetVersion(string version) /// the address of the package repositories (currently only folders are supported) /// should we run recursively /// this CmfPackage for chaining, but the method itself is mutable - public void LoadDependencies(Uri[] repoUris, bool recurse = false) + public void LoadDependencies(IEnumerable repoUris, bool recurse = false) { - var loadedPackages = new List(); + List loadedPackages = new(); loadedPackages.Add(this); Log.Progress($"Working on {this.Name ?? (this.PackageId + "@" + this.Version)}"); @@ -516,8 +507,6 @@ public void LoadDependencies(Uri[] repoUris, bool recurse = false) } } - - #region Static Methods /// @@ -571,20 +560,19 @@ public static CmfPackage LoadFromRepo(IDirectoryInfo[] repoDirectories, string p .Select(r => r.GetFiles(_dependencyFileName).FirstOrDefault()) .Where(r => r != null) .FirstOrDefault(); + if (dependencyFile != null) { var zip = ZipFile.Open(dependencyFile.FullName, ZipArchiveMode.Read); var manifest = zip.GetEntry(CliConstants.DeploymentFrameworkManifestFileName); if (manifest != null) { - using (var stream = manifest.Open()) - using (var reader = new StreamReader(stream)) + using var stream = manifest.Open(); + using var reader = new StreamReader(stream); + cmfPackage = FromManifest(reader.ReadToEnd(), setDefaultValues: true); + if (cmfPackage != null) { - cmfPackage = FromManifest(reader.ReadToEnd(), setDefaultValues: true); - if (cmfPackage != null) - { - cmfPackage.Uri = new(dependencyFile.FullName); - } + cmfPackage.Uri = new(dependencyFile.FullName); } } } @@ -611,7 +599,7 @@ public static CmfPackage FromManifest(string manifest, bool setDefaultValues = f { throw new CliException(string.Format(CliMessages.InvalidManifestFile)); } - DependencyCollection deps = new DependencyCollection(); + DependencyCollection deps = new(); foreach (XElement element in rootNode.Elements()) { // Get the Property Value based on the Token name @@ -718,4 +706,4 @@ public override int GetHashCode() #endregion } -} \ No newline at end of file +} diff --git a/cmf-cli/Utilities/CliException.cs b/cmf-cli/Utilities/CliException.cs index e818dda2..79c080cb 100644 --- a/cmf-cli/Utilities/CliException.cs +++ b/cmf-cli/Utilities/CliException.cs @@ -25,6 +25,17 @@ public CliException(string message) : base(message) Log.Error(message); } + /// + /// Initializes a new instance of the class. + /// + /// The message that describes the error. + /// + public CliException(string message, params object[] args) : base(message) + { + message = string.Format(message, args); + Log.Error(message); + } + /// /// Initializes a new instance of the class. /// @@ -45,4 +56,4 @@ public CliException(string message, Exception innerException) : base(message, in protected CliException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { } } -} \ No newline at end of file +} diff --git a/docs/cmf/Cmf_Common_Cli.md b/docs/cmf/Cmf_Common_Cli.md index 2d345a9f..3fd58ef9 100644 --- a/docs/cmf/Cmf_Common_Cli.md +++ b/docs/cmf/Cmf_Common_Cli.md @@ -29,6 +29,15 @@ internal static System.Globalization.CultureInfo Culture { get; set; } #### Property Value [System.Globalization.CultureInfo](https://docs.microsoft.com/en-us/dotnet/api/System.Globalization.CultureInfo 'System.Globalization.CultureInfo') + +## CliMessages.GetPackage Property +Looks up a localized string similar to Get Package {0}.{1}.... +```csharp +internal static string GetPackage { get; } +``` +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + ## CliMessages.InvalidManifestFile Property Looks up a localized string similar to It was not possible to read the manifest file.. @@ -83,6 +92,15 @@ internal static string MissingMandatoryPropertyInFile { get; } #### Property Value [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +## CliMessages.NotARootPackage Property +Looks up a localized string similar to This is not a root package. +```csharp +internal static string NotARootPackage { get; } +``` +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + ## CliMessages.NotFound Property Looks up a localized string similar to {0} not found!. @@ -92,6 +110,15 @@ internal static string NotFound { get; } #### Property Value [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +## CliMessages.PackageHasNoTestPackages Property +Looks up a localized string similar to Package {0}.{1} has no test packages. +```csharp +internal static string PackageHasNoTestPackages { get; } +``` +#### Property Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + ## CliMessages.PackageRootNotFound Property Looks up a localized string similar to Cannot find package root. Are you in a valid package directory?. diff --git a/docs/cmf/Cmf_Common_Cli_Commands.md b/docs/cmf/Cmf_Common_Cli_Commands.md index cd551de0..e142ed2a 100644 --- a/docs/cmf/Cmf_Common_Cli_Commands.md +++ b/docs/cmf/Cmf_Common_Cli_Commands.md @@ -3,56 +3,62 @@ ### Classes ## AssembleCommand Class -This command will be responsible for assemble a package based on a given cmfpackage and respective dependencies +This command will be responsible for assembling a package based on a given cmfpackage and respective dependencies ```csharp public class AssembleCommand : Cmf.Common.Cli.Commands.BaseCommand ``` Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 [BaseCommand](Cmf_Common_Cli_Commands.md#Cmf_Common_Cli_Commands_BaseCommand 'Cmf.Common.Cli.Commands.BaseCommand') 🡒 AssembleCommand ### Methods - -## AssembleCommand.AssembleDependencies(IDirectoryInfo, Uri[], CmfPackage, DependencyCollection) Method + +## AssembleCommand.AssembleDependencies(IDirectoryInfo, Uri, IEnumerable<Uri>, CmfPackage, DependencyCollection) Method Publish Dependencies from one package. recursive operation ```csharp -private void AssembleDependencies(System.IO.Abstractions.IDirectoryInfo outputDir, System.Uri[] repos, Cmf.Common.Cli.Objects.CmfPackage cmfPackage, Cmf.Common.Cli.Objects.DependencyCollection loadedDependencies=null); +private void AssembleDependencies(System.IO.Abstractions.IDirectoryInfo outputDir, System.Uri ciRepo, System.Collections.Generic.IEnumerable repos, Cmf.Common.Cli.Objects.CmfPackage cmfPackage, Cmf.Common.Cli.Objects.DependencyCollection assembledDependencies=null); ``` #### Parameters - + `outputDir` [System.IO.Abstractions.IDirectoryInfo](https://docs.microsoft.com/en-us/dotnet/api/System.IO.Abstractions.IDirectoryInfo 'System.IO.Abstractions.IDirectoryInfo') Destination for the dependencies package and also used for the current package - -`repos` [System.Uri](https://docs.microsoft.com/en-us/dotnet/api/System.Uri 'System.Uri')[[]](https://docs.microsoft.com/en-us/dotnet/api/System.Array 'System.Array') + +`ciRepo` [System.Uri](https://docs.microsoft.com/en-us/dotnet/api/System.Uri 'System.Uri') + + +`repos` [System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[System.Uri](https://docs.microsoft.com/en-us/dotnet/api/System.Uri 'System.Uri')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') The repos. - + `cmfPackage` [CmfPackage](Cmf_Common_Cli_Objects.md#Cmf_Common_Cli_Objects_CmfPackage 'Cmf.Common.Cli.Objects.CmfPackage') The CMF package. - -`loadedDependencies` [DependencyCollection](Cmf_Common_Cli_Objects.md#Cmf_Common_Cli_Objects_DependencyCollection 'Cmf.Common.Cli.Objects.DependencyCollection') + +`assembledDependencies` [DependencyCollection](Cmf_Common_Cli_Objects.md#Cmf_Common_Cli_Objects_DependencyCollection 'Cmf.Common.Cli.Objects.DependencyCollection') The loaded dependencies. - -## AssembleCommand.AssemblePackage(IDirectoryInfo, Uri[], CmfPackage) Method + +## AssembleCommand.AssemblePackage(IDirectoryInfo, IEnumerable<Uri>, CmfPackage, bool) Method Publish a package to the output directory ```csharp -private void AssemblePackage(System.IO.Abstractions.IDirectoryInfo outputDir, System.Uri[] repos, Cmf.Common.Cli.Objects.CmfPackage cmfPackage); +private void AssemblePackage(System.IO.Abstractions.IDirectoryInfo outputDir, System.Collections.Generic.IEnumerable repos, Cmf.Common.Cli.Objects.CmfPackage cmfPackage, bool includeTestPackages=false); ``` #### Parameters - + `outputDir` [System.IO.Abstractions.IDirectoryInfo](https://docs.microsoft.com/en-us/dotnet/api/System.IO.Abstractions.IDirectoryInfo 'System.IO.Abstractions.IDirectoryInfo') Destiny for the package - -`repos` [System.Uri](https://docs.microsoft.com/en-us/dotnet/api/System.Uri 'System.Uri')[[]](https://docs.microsoft.com/en-us/dotnet/api/System.Array 'System.Array') + +`repos` [System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[System.Uri](https://docs.microsoft.com/en-us/dotnet/api/System.Uri 'System.Uri')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') The repos. - + `cmfPackage` [CmfPackage](Cmf_Common_Cli_Objects.md#Cmf_Common_Cli_Objects_CmfPackage 'Cmf.Common.Cli.Objects.CmfPackage') The CMF package. + +`includeTestPackages` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') + #### Exceptions [CliException](Cmf_Common_Cli_Utilities.md#Cmf_Common_Cli_Utilities_CliException 'Cmf.Common.Cli.Utilities.CliException') @@ -67,26 +73,29 @@ public override void Configure(System.CommandLine.Command cmd); `cmd` [System.CommandLine.Command](https://docs.microsoft.com/en-us/dotnet/api/System.CommandLine.Command 'System.CommandLine.Command') - -## AssembleCommand.Execute(IDirectoryInfo, IDirectoryInfo, Uri[], bool) Method + +## AssembleCommand.Execute(IDirectoryInfo, IDirectoryInfo, Uri, Uri[], bool) Method Executes the specified working dir. ```csharp -public void Execute(System.IO.Abstractions.IDirectoryInfo workingDir, System.IO.Abstractions.IDirectoryInfo outputDir, System.Uri[] repos, bool includeTestPackages); +public void Execute(System.IO.Abstractions.IDirectoryInfo workingDir, System.IO.Abstractions.IDirectoryInfo outputDir, System.Uri ciRepo, System.Uri[] repos, bool includeTestPackages); ``` #### Parameters - + `workingDir` [System.IO.Abstractions.IDirectoryInfo](https://docs.microsoft.com/en-us/dotnet/api/System.IO.Abstractions.IDirectoryInfo 'System.IO.Abstractions.IDirectoryInfo') The working dir. - + `outputDir` [System.IO.Abstractions.IDirectoryInfo](https://docs.microsoft.com/en-us/dotnet/api/System.IO.Abstractions.IDirectoryInfo 'System.IO.Abstractions.IDirectoryInfo') The output dir. - + +`ciRepo` [System.Uri](https://docs.microsoft.com/en-us/dotnet/api/System.Uri 'System.Uri') + + `repos` [System.Uri](https://docs.microsoft.com/en-us/dotnet/api/System.Uri 'System.Uri')[[]](https://docs.microsoft.com/en-us/dotnet/api/System.Array 'System.Array') The repo. - + `includeTestPackages` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') True to publish test packages @@ -789,41 +798,41 @@ Derived ↳ [TestCommand](Cmf_Common_Cli_Commands_New.md#Cmf_Common_Cli_Commands_New_TestCommand 'Cmf.Common.Cli.Commands.New.TestCommand') ↳ [UILayerTemplateCommand](Cmf_Common_Cli_Commands.md#Cmf_Common_Cli_Commands_UILayerTemplateCommand 'Cmf.Common.Cli.Commands.UILayerTemplateCommand') ### Constructors - -## LayerTemplateCommand.LayerTemplateCommand(string, string, IFileSystem) Constructor + +## LayerTemplateCommand.LayerTemplateCommand(string, string) Constructor constructor ```csharp -protected LayerTemplateCommand(string commandName, string packagePrefix, System.IO.Abstractions.IFileSystem fileSystem); +protected LayerTemplateCommand(string commandName, string packagePrefix); ``` #### Parameters - + `commandName` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') the name of the command - + `packagePrefix` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') the package prefix. used as full name if not inside a feature. - -`fileSystem` [System.IO.Abstractions.IFileSystem](https://docs.microsoft.com/en-us/dotnet/api/System.IO.Abstractions.IFileSystem 'System.IO.Abstractions.IFileSystem') -the filesystem implementation - - -## LayerTemplateCommand.LayerTemplateCommand(string, string) Constructor + +## LayerTemplateCommand.LayerTemplateCommand(string, string, IFileSystem) Constructor constructor ```csharp -protected LayerTemplateCommand(string commandName, string packagePrefix); +protected LayerTemplateCommand(string commandName, string packagePrefix, System.IO.Abstractions.IFileSystem fileSystem); ``` #### Parameters - + `commandName` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') the name of the command - + `packagePrefix` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') the package prefix. used as full name if not inside a feature. + +`fileSystem` [System.IO.Abstractions.IFileSystem](https://docs.microsoft.com/en-us/dotnet/api/System.IO.Abstractions.IFileSystem 'System.IO.Abstractions.IFileSystem') +the filesystem implementation + ### Fields @@ -1316,30 +1325,30 @@ Derived ↳ [FeatureCommand](Cmf_Common_Cli_Commands_New.md#Cmf_Common_Cli_Commands_New_FeatureCommand 'Cmf.Common.Cli.Commands.New.FeatureCommand') ↳ [NewCommand](Cmf_Common_Cli_Commands.md#Cmf_Common_Cli_Commands_NewCommand 'Cmf.Common.Cli.Commands.NewCommand') ### Constructors - -## TemplateCommand.TemplateCommand(string, IFileSystem) Constructor + +## TemplateCommand.TemplateCommand(string) Constructor constructor ```csharp -protected TemplateCommand(string commandName, System.IO.Abstractions.IFileSystem fileSystem); +protected TemplateCommand(string commandName); ``` #### Parameters - + `commandName` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') - -`fileSystem` [System.IO.Abstractions.IFileSystem](https://docs.microsoft.com/en-us/dotnet/api/System.IO.Abstractions.IFileSystem 'System.IO.Abstractions.IFileSystem') - - -## TemplateCommand.TemplateCommand(string) Constructor + +## TemplateCommand.TemplateCommand(string, IFileSystem) Constructor constructor ```csharp -protected TemplateCommand(string commandName); +protected TemplateCommand(string commandName, System.IO.Abstractions.IFileSystem fileSystem); ``` #### Parameters - + `commandName` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +`fileSystem` [System.IO.Abstractions.IFileSystem](https://docs.microsoft.com/en-us/dotnet/api/System.IO.Abstractions.IFileSystem 'System.IO.Abstractions.IFileSystem') + ### Methods @@ -1439,41 +1448,41 @@ Derived ↳ [HelpCommand](Cmf_Common_Cli_Commands_New.md#Cmf_Common_Cli_Commands_New_HelpCommand 'Cmf.Common.Cli.Commands.New.HelpCommand') ↳ [HTMLCommand](Cmf_Common_Cli_Commands_New.md#Cmf_Common_Cli_Commands_New_HTMLCommand 'Cmf.Common.Cli.Commands.New.HTMLCommand') ### Constructors - -## UILayerTemplateCommand.UILayerTemplateCommand(string, string, IFileSystem) Constructor + +## UILayerTemplateCommand.UILayerTemplateCommand(string, string) Constructor constructor ```csharp -protected UILayerTemplateCommand(string commandName, string packagePrefix, System.IO.Abstractions.IFileSystem fileSystem); +protected UILayerTemplateCommand(string commandName, string packagePrefix); ``` #### Parameters - + `commandName` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') the name of the command - + `packagePrefix` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') the package prefix. used as full name if not inside a feature. - -`fileSystem` [System.IO.Abstractions.IFileSystem](https://docs.microsoft.com/en-us/dotnet/api/System.IO.Abstractions.IFileSystem 'System.IO.Abstractions.IFileSystem') -the filesystem implementation - - -## UILayerTemplateCommand.UILayerTemplateCommand(string, string) Constructor + +## UILayerTemplateCommand.UILayerTemplateCommand(string, string, IFileSystem) Constructor constructor ```csharp -protected UILayerTemplateCommand(string commandName, string packagePrefix); +protected UILayerTemplateCommand(string commandName, string packagePrefix, System.IO.Abstractions.IFileSystem fileSystem); ``` #### Parameters - + `commandName` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') the name of the command - + `packagePrefix` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') the package prefix. used as full name if not inside a feature. + +`fileSystem` [System.IO.Abstractions.IFileSystem](https://docs.microsoft.com/en-us/dotnet/api/System.IO.Abstractions.IFileSystem 'System.IO.Abstractions.IFileSystem') +the filesystem implementation + ### Methods diff --git a/docs/cmf/Cmf_Common_Cli_Constants.md b/docs/cmf/Cmf_Common_Cli_Constants.md index cc7fbb33..04bf1d5f 100644 --- a/docs/cmf/Cmf_Common_Cli_Constants.md +++ b/docs/cmf/Cmf_Common_Cli_Constants.md @@ -72,6 +72,15 @@ public const string FolderTemplates = templateFiles; #### Field Value [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + +## CliConstants.FolderTests Field +Tests Folder +```csharp +public const string FolderTests = /Tests; +``` +#### Field Value +[System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') + ## CliConstants.LBOsFileLocation Field The lb os file location diff --git a/docs/cmf/Cmf_Common_Cli_Handlers.md b/docs/cmf/Cmf_Common_Cli_Handlers.md index 5c262805..0ed30b88 100644 --- a/docs/cmf/Cmf_Common_Cli_Handlers.md +++ b/docs/cmf/Cmf_Common_Cli_Handlers.md @@ -345,32 +345,32 @@ Derived Implements [IPackageTypeHandler](Cmf_Common_Cli_Interfaces.md#Cmf_Common_Cli_Interfaces_IPackageTypeHandler 'Cmf.Common.Cli.Interfaces.IPackageTypeHandler') ### Constructors - -## PackageTypeHandler.PackageTypeHandler(CmfPackage, IFileSystem) Constructor + +## PackageTypeHandler.PackageTypeHandler(CmfPackage) Constructor Initializes a new instance of the [PackageTypeHandler](Cmf_Common_Cli_Handlers.md#Cmf_Common_Cli_Handlers_PackageTypeHandler 'Cmf.Common.Cli.Handlers.PackageTypeHandler') class. ```csharp -public PackageTypeHandler(Cmf.Common.Cli.Objects.CmfPackage cmfPackage, System.IO.Abstractions.IFileSystem fileSystem); +public PackageTypeHandler(Cmf.Common.Cli.Objects.CmfPackage cmfPackage); ``` #### Parameters - + `cmfPackage` [CmfPackage](Cmf_Common_Cli_Objects.md#Cmf_Common_Cli_Objects_CmfPackage 'Cmf.Common.Cli.Objects.CmfPackage') - -`fileSystem` [System.IO.Abstractions.IFileSystem](https://docs.microsoft.com/en-us/dotnet/api/System.IO.Abstractions.IFileSystem 'System.IO.Abstractions.IFileSystem') - +#### Exceptions +[CliException](Cmf_Common_Cli_Utilities.md#Cmf_Common_Cli_Utilities_CliException 'Cmf.Common.Cli.Utilities.CliException') - -## PackageTypeHandler.PackageTypeHandler(CmfPackage) Constructor + +## PackageTypeHandler.PackageTypeHandler(CmfPackage, IFileSystem) Constructor Initializes a new instance of the [PackageTypeHandler](Cmf_Common_Cli_Handlers.md#Cmf_Common_Cli_Handlers_PackageTypeHandler 'Cmf.Common.Cli.Handlers.PackageTypeHandler') class. ```csharp -public PackageTypeHandler(Cmf.Common.Cli.Objects.CmfPackage cmfPackage); +public PackageTypeHandler(Cmf.Common.Cli.Objects.CmfPackage cmfPackage, System.IO.Abstractions.IFileSystem fileSystem); ``` #### Parameters - + `cmfPackage` [CmfPackage](Cmf_Common_Cli_Objects.md#Cmf_Common_Cli_Objects_CmfPackage 'Cmf.Common.Cli.Objects.CmfPackage') -#### Exceptions -[CliException](Cmf_Common_Cli_Utilities.md#Cmf_Common_Cli_Utilities_CliException 'Cmf.Common.Cli.Utilities.CliException') + +`fileSystem` [System.IO.Abstractions.IFileSystem](https://docs.microsoft.com/en-us/dotnet/api/System.IO.Abstractions.IFileSystem 'System.IO.Abstractions.IFileSystem') + ### Fields diff --git a/docs/cmf/Cmf_Common_Cli_Objects.md b/docs/cmf/Cmf_Common_Cli_Objects.md index db084592..d2841e03 100644 --- a/docs/cmf/Cmf_Common_Cli_Objects.md +++ b/docs/cmf/Cmf_Common_Cli_Objects.md @@ -433,20 +433,20 @@ the underlying file system [CliException](Cmf_Common_Cli_Utilities.md#Cmf_Common_Cli_Utilities_CliException 'Cmf.Common.Cli.Utilities.CliException') [CliException](Cmf_Common_Cli_Utilities.md#Cmf_Common_Cli_Utilities_CliException 'Cmf.Common.Cli.Utilities.CliException') - -## CmfPackage.LoadDependencies(Uri[], bool) Method + +## CmfPackage.LoadDependencies(IEnumerable<Uri>, bool) Method Builds a dependency tree by attaching the CmfPackage objects to the parent's dependencies Can run recursively and fetch packages from a DF repository. Supports cycles ```csharp -public void LoadDependencies(System.Uri[] repoUris, bool recurse=false); +public void LoadDependencies(System.Collections.Generic.IEnumerable repoUris, bool recurse=false); ``` #### Parameters - -`repoUris` [System.Uri](https://docs.microsoft.com/en-us/dotnet/api/System.Uri 'System.Uri')[[]](https://docs.microsoft.com/en-us/dotnet/api/System.Array 'System.Array') + +`repoUris` [System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[System.Uri](https://docs.microsoft.com/en-us/dotnet/api/System.Uri 'System.Uri')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') the address of the package repositories (currently only folders are supported) - + `recurse` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') should we run recursively @@ -542,15 +542,6 @@ The version. #### Exceptions [System.NotImplementedException](https://docs.microsoft.com/en-us/dotnet/api/System.NotImplementedException 'System.NotImplementedException') - -## CmfPackage.ShallowCopy() Method -Shallows the copy. -```csharp -private Cmf.Common.Cli.Objects.CmfPackage ShallowCopy(); -``` -#### Returns -[CmfPackage](Cmf_Common_Cli_Objects.md#Cmf_Common_Cli_Objects_CmfPackage 'Cmf.Common.Cli.Objects.CmfPackage') - ## CmfPackage.ValidatePackage() Method Validates the package. @@ -800,37 +791,37 @@ public class DependencyCollection : System.Collections.Generic.List -## DependencyCollection.Contains(Dependency, bool) Method -Determines whether this instance contains the object. + +## DependencyCollection.Contains(Dependency) Method +Gets the dependency. ```csharp -public bool Contains(Cmf.Common.Cli.Objects.Dependency dependency, bool ignoreVersion); +public bool Contains(Cmf.Common.Cli.Objects.Dependency dependency); ``` #### Parameters - + `dependency` [Dependency](Cmf_Common_Cli_Objects.md#Cmf_Common_Cli_Objects_Dependency 'Cmf.Common.Cli.Objects.Dependency') The dependency. - -`ignoreVersion` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') -if set to `true` [ignore version]. - #### Returns [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') `true` if [contains] [the specified dependency]; otherwise, `false`. - -## DependencyCollection.Contains(Dependency) Method -Gets the dependency. + +## DependencyCollection.Contains(Dependency, bool) Method +Determines whether this instance contains the object. ```csharp -public bool Contains(Cmf.Common.Cli.Objects.Dependency dependency); +public bool Contains(Cmf.Common.Cli.Objects.Dependency dependency, bool ignoreVersion); ``` #### Parameters - + `dependency` [Dependency](Cmf_Common_Cli_Objects.md#Cmf_Common_Cli_Objects_Dependency 'Cmf.Common.Cli.Objects.Dependency') The dependency. + +`ignoreVersion` [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') +if set to `true` [ignore version]. + #### Returns [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') `true` if [contains] [the specified dependency]; otherwise, `false`. @@ -938,6 +929,21 @@ Initializes a new instance of the [Step](Cmf_Common_Cli_Objects.md#Cmf_Common_Cl public Step(); ``` + +## Step.Step(Nullable<StepType>) Constructor +Initializes a new instance of the [Step](Cmf_Common_Cli_Objects.md#Cmf_Common_Cli_Objects_Step 'Cmf.Common.Cli.Objects.Step') class. +```csharp +public Step(System.Nullable type); +``` +#### Parameters + +`type` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[StepType](Cmf_Common_Cli_Enums.md#Cmf_Common_Cli_Enums_StepType 'Cmf.Common.Cli.Enums.StepType')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') +The type. + +#### Exceptions +[System.ArgumentNullException](https://docs.microsoft.com/en-us/dotnet/api/System.ArgumentNullException 'System.ArgumentNullException') +type + ## Step.Step(Nullable<StepType>, string, string, string, string, Nullable<bool>, string, Nullable<MessageType>) Constructor Initializes a new instance of the [Step](Cmf_Common_Cli_Objects.md#Cmf_Common_Cli_Objects_Step 'Cmf.Common.Cli.Objects.Step') class. @@ -981,21 +987,6 @@ Type of the message. [System.ArgumentNullException](https://docs.microsoft.com/en-us/dotnet/api/System.ArgumentNullException 'System.ArgumentNullException') type - -## Step.Step(Nullable<StepType>) Constructor -Initializes a new instance of the [Step](Cmf_Common_Cli_Objects.md#Cmf_Common_Cli_Objects_Step 'Cmf.Common.Cli.Objects.Step') class. -```csharp -public Step(System.Nullable type); -``` -#### Parameters - -`type` [System.Nullable<](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1')[StepType](Cmf_Common_Cli_Enums.md#Cmf_Common_Cli_Enums_StepType 'Cmf.Common.Cli.Enums.StepType')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System.Nullable`1') -The type. - -#### Exceptions -[System.ArgumentNullException](https://docs.microsoft.com/en-us/dotnet/api/System.ArgumentNullException 'System.ArgumentNullException') -type - ### Properties ## Step.ContentPath Property diff --git a/docs/cmf/Cmf_Common_Cli_Utilities.md b/docs/cmf/Cmf_Common_Cli_Utilities.md index 8ca6c8aa..d2bf26be 100644 --- a/docs/cmf/Cmf_Common_Cli_Utilities.md +++ b/docs/cmf/Cmf_Common_Cli_Utilities.md @@ -16,6 +16,33 @@ Initializes a new instance of the [CliException](Cmf_Common_Cli_Utilities.md#Cmf public CliException(); ``` + +## CliException.CliException(string) Constructor +Initializes a new instance of the [CliException](Cmf_Common_Cli_Utilities.md#Cmf_Common_Cli_Utilities_CliException 'Cmf.Common.Cli.Utilities.CliException') class. +```csharp +public CliException(string message); +``` +#### Parameters + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') +The message that describes the error. + + + +## CliException.CliException(string, object[]) Constructor +Initializes a new instance of the [CliException](Cmf_Common_Cli_Utilities.md#Cmf_Common_Cli_Utilities_CliException 'Cmf.Common.Cli.Utilities.CliException') class. +```csharp +public CliException(string message, params object[] args); +``` +#### Parameters + +`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') +The message that describes the error. + + +`args` [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object')[[]](https://docs.microsoft.com/en-us/dotnet/api/System.Array 'System.Array') + + ## CliException.CliException(string, Exception) Constructor Initializes a new instance of the [CliException](Cmf_Common_Cli_Utilities.md#Cmf_Common_Cli_Utilities_CliException 'Cmf.Common.Cli.Utilities.CliException') class. @@ -32,18 +59,6 @@ The error message that explains the reason for the exception. The exception that is the cause of the current exception, or a null reference ([Nothing](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/Nothing 'https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/Nothing') in Visual Basic) if no inner exception is specified. - -## CliException.CliException(string) Constructor -Initializes a new instance of the [CliException](Cmf_Common_Cli_Utilities.md#Cmf_Common_Cli_Utilities_CliException 'Cmf.Common.Cli.Utilities.CliException') class. -```csharp -public CliException(string message); -``` -#### Parameters - -`message` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') -The message that describes the error. - - ## CliException.CliException(SerializationInfo, StreamingContext) Constructor Initializes a new instance of the [CliException](Cmf_Common_Cli_Utilities.md#Cmf_Common_Cli_Utilities_CliException 'Cmf.Common.Cli.Utilities.CliException') class. @@ -160,46 +175,46 @@ The object. `true` if [has] [the specified object]; otherwise, `false`. - -## ExtensionMethods.HasAny<TSource>(IEnumerable<TSource>, Func<TSource,bool>) Method + +## ExtensionMethods.HasAny<TSource>(IEnumerable<TSource>) Method Determines whether a sequence contains any elements. ```csharp -public static bool HasAny(this System.Collections.Generic.IEnumerable source, System.Func predicate=null); +public static bool HasAny(this System.Collections.Generic.IEnumerable source); ``` #### Type parameters - + `TSource` The type of the source. #### Parameters - -`source` [System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[TSource](Cmf_Common_Cli_Utilities.md#Cmf_Common_Cli_Utilities_ExtensionMethods_HasAny_TSource_(System_Collections_Generic_IEnumerable_TSource__System_Func_TSource_bool_)_TSource 'Cmf.Common.Cli.Utilities.ExtensionMethods.HasAny<TSource>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource,bool>).TSource')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') + +`source` [System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[TSource](Cmf_Common_Cli_Utilities.md#Cmf_Common_Cli_Utilities_ExtensionMethods_HasAny_TSource_(System_Collections_Generic_IEnumerable_TSource_)_TSource 'Cmf.Common.Cli.Utilities.ExtensionMethods.HasAny<TSource>(System.Collections.Generic.IEnumerable<TSource>).TSource')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') The source. - -`predicate` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TSource](Cmf_Common_Cli_Utilities.md#Cmf_Common_Cli_Utilities_ExtensionMethods_HasAny_TSource_(System_Collections_Generic_IEnumerable_TSource__System_Func_TSource_bool_)_TSource 'Cmf.Common.Cli.Utilities.ExtensionMethods.HasAny<TSource>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource,bool>).TSource')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') - #### Returns [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') `true` if the specified source has any; otherwise, `false`. - -## ExtensionMethods.HasAny<TSource>(IEnumerable<TSource>) Method + +## ExtensionMethods.HasAny<TSource>(IEnumerable<TSource>, Func<TSource,bool>) Method Determines whether a sequence contains any elements. ```csharp -public static bool HasAny(this System.Collections.Generic.IEnumerable source); +public static bool HasAny(this System.Collections.Generic.IEnumerable source, System.Func predicate=null); ``` #### Type parameters - + `TSource` The type of the source. #### Parameters - -`source` [System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[TSource](Cmf_Common_Cli_Utilities.md#Cmf_Common_Cli_Utilities_ExtensionMethods_HasAny_TSource_(System_Collections_Generic_IEnumerable_TSource_)_TSource 'Cmf.Common.Cli.Utilities.ExtensionMethods.HasAny<TSource>(System.Collections.Generic.IEnumerable<TSource>).TSource')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') + +`source` [System.Collections.Generic.IEnumerable<](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1')[TSource](Cmf_Common_Cli_Utilities.md#Cmf_Common_Cli_Utilities_ExtensionMethods_HasAny_TSource_(System_Collections_Generic_IEnumerable_TSource__System_Func_TSource_bool_)_TSource 'Cmf.Common.Cli.Utilities.ExtensionMethods.HasAny<TSource>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource,bool>).TSource')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.IEnumerable-1 'System.Collections.Generic.IEnumerable`1') The source. + +`predicate` [System.Func<](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[TSource](Cmf_Common_Cli_Utilities.md#Cmf_Common_Cli_Utilities_ExtensionMethods_HasAny_TSource_(System_Collections_Generic_IEnumerable_TSource__System_Func_TSource_bool_)_TSource 'Cmf.Common.Cli.Utilities.ExtensionMethods.HasAny<TSource>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource,bool>).TSource')[,](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2')[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean')[>](https://docs.microsoft.com/en-us/dotnet/api/System.Func-2 'System.Func`2') + #### Returns [System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') `true` if the specified source has any; otherwise, `false`. diff --git a/docs/cmf/cmf.xml b/docs/cmf/cmf.xml index 017f5f7c..e7146d88 100644 --- a/docs/cmf/cmf.xml +++ b/docs/cmf/cmf.xml @@ -444,6 +444,11 @@ Looks up a localized string similar to Nothing was found on ContentToPack Sources of {0}.{1}. + + + Looks up a localized string similar to Get Package {0}.{1}.... + + Looks up a localized string similar to It was not possible to read the manifest file.. @@ -474,11 +479,21 @@ Looks up a localized string similar to Missing mandatory property {0} in file {1}. + + + Looks up a localized string similar to This is not a root package. + + Looks up a localized string similar to {0} not found!. + + + Looks up a localized string similar to Package {0}.{1} has no test packages. + + Looks up a localized string similar to Cannot find package root. Are you in a valid package directory?. @@ -496,29 +511,28 @@ - This command will be responsible for assemble a package based on a given cmfpackage and respective dependencies + This command will be responsible for assembling a package based on a given cmfpackage and respective dependencies - + Publish Dependencies from one package. recursive operation Destination for the dependencies package and also used for the current package + The repos. The CMF package. - The loaded dependencies. + The loaded dependencies. - + Publish a package to the output directory Destiny for the package The repos. The CMF package. - - True if package was coppied - + @@ -527,12 +541,13 @@ - + Executes the specified working dir. The working dir. The output dir. + The repo. True to publish test packages @@ -1404,6 +1419,11 @@ The folder install dependencies + + + Tests Folder + + The deployment framework manifest template @@ -2390,12 +2410,6 @@ Validates the package. - - - Shallows the copy. - - - Initializes a new instance of the class. @@ -2471,7 +2485,7 @@ The version. - + Builds a dependency tree by attaching the CmfPackage objects to the parent's dependencies Can run recursively and fetch packages from a DF repository. @@ -2886,6 +2900,13 @@ The message that describes the error. + + + Initializes a new instance of the class. + + The message that describes the error. + + Initializes a new instance of the class.