move projects to src folder

This commit is contained in:
Matt Parker
2025-05-18 14:04:50 +10:00
parent 4310f63f86
commit 4bd972f905
49 changed files with 7 additions and 5 deletions

View File

@@ -0,0 +1,24 @@
namespace DotNetSolutionTools.Core.Common;
public static class CsprojHelper
{
public static string[] RetrieveAllCSharpProjectFullPathsFromFolder(string solutionFolderPath)
{
// if solutionFolderPath does not end with a slash, add one
if (solutionFolderPath[^1] != Path.DirectorySeparatorChar)
{
solutionFolderPath += Path.DirectorySeparatorChar;
}
var csprojList = Directory.GetFiles(solutionFolderPath, "*.csproj", SearchOption.AllDirectories);
return csprojList;
}
public static string[] RetrieveAllCSharpProjectFullPathsFromSolution(string solutionFilePath)
{
var solutionFile = SlnHelper.ParseSolutionFileFromPath(solutionFilePath);
ArgumentNullException.ThrowIfNull(solutionFile);
var result = SlnHelper.GetCSharpProjectObjectsFromSolutionFile(solutionFile);
var csprojList = result.Select(x => x.FullPath).ToArray();
return csprojList;
}
}