file recursion

This commit is contained in:
femsci 2023-12-11 10:39:50 +01:00
parent 1abdcd2cf5
commit 6bbcec53a3
Signed by: femsci
GPG key ID: 08F7911F0E650C67
2 changed files with 19 additions and 1 deletions

View file

@ -11,4 +11,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Build" Version="17.8.3" />
</ItemGroup>
</Project>

View file

@ -1,4 +1,6 @@
using System.Reflection.Metadata.Ecma335;
using Microsoft.Build.Construction;
using Microsoft.Build.Execution;
namespace Nyanbyte.DotnetTools.Rename;
@ -22,6 +24,18 @@ public class Program
return;
}
FileInfo? sln = projs.SingleOrDefault(f => f.Extension == "sln");
FileInfo? slnFile = projs.SingleOrDefault(f => f.Extension == "sln");
if (slnFile is not null)
{
SolutionFile sln = SolutionFile.Parse(slnFile.FullName);
projs = sln.ProjectsInOrder.Select(p => new FileInfo(p.AbsolutePath)).ToList();
}
foreach (var proj in projs)
{
ProjectInstance pi = ProjectInstance.FromFile(proj.FullName, new());
string projDir = Path.GetDirectoryName(pi.FullPath)!;
throw new NotImplementedException();
}
}
}