create helper classes

This commit is contained in:
Matthew Parker [SSW]
2024-01-21 14:59:19 +10:00
parent 3f5905349d
commit 22af01dc48
16 changed files with 225 additions and 215 deletions

View File

@@ -1,5 +1,6 @@
using System.ComponentModel;
using DotNetSolutionTools.Core;
using DotNetSolutionTools.Core.Common;
using Spectre.Console.Cli;
namespace DotNetSolutionTools.CLI.Commands;
@@ -15,9 +16,7 @@ public class CompareCommand : Command<CompareCommand.Settings>
public required string SolutionFilePath { get; set; }
[CommandOption("-l|--logprojectfiles")]
[Description(
"true to enable log output of all project files found in folder. Default is false."
)]
[Description("true to enable log output of all project files found in folder. Default is false.")]
[DefaultValue(false)]
public bool LogAllProjectFileNames { get; set; } = false;
}
@@ -28,9 +27,7 @@ public class CompareCommand : Command<CompareCommand.Settings>
var pathToSolutionFile = settings.SolutionFilePath;
Console.WriteLine($"Retrieving C# Projects from {folderDirectory}");
var csprojList = SolutionProjectParity.RetrieveAllCSharpProjectNamesFromFolder(
folderDirectory
);
var csprojList = CsprojHelper.RetrieveAllCSharpProjectFullPathsFromFolder(folderDirectory);
if (settings.LogAllProjectFileNames)
{
@@ -45,12 +42,10 @@ public class CompareCommand : Command<CompareCommand.Settings>
Console.WriteLine($"Parsing Solution File: {pathToSolutionFile}");
// Load the solution file
var solutionFile = SolutionProjectParity.ParseSolutionFileFromPath(pathToSolutionFile);
var solutionFile = SlnHelper.ParseSolutionFileFromPath(pathToSolutionFile);
if (solutionFile == null)
{
Console.WriteLine(
"Failed to parse solution file. The file was either not found or malformed."
);
Console.WriteLine("Failed to parse solution file. The file was either not found or malformed.");
return 1;
}
@@ -61,9 +56,7 @@ public class CompareCommand : Command<CompareCommand.Settings>
);
Console.WriteLine("==================================================");
Console.WriteLine(
$"Missing {projectsMissingFromSolution.Count} C# Projects from Solution File"
);
Console.WriteLine($"Missing {projectsMissingFromSolution.Count} C# Projects from Solution File");
foreach (var project in projectsMissingFromSolution)
{