diff --git a/src/Nyanbyte.DotnetTools.Rename/Nyanbyte.DotnetTools.Rename.csproj b/src/Nyanbyte.DotnetTools.Rename/Nyanbyte.DotnetTools.Rename.csproj index e42bff0..bf8ccc9 100644 --- a/src/Nyanbyte.DotnetTools.Rename/Nyanbyte.DotnetTools.Rename.csproj +++ b/src/Nyanbyte.DotnetTools.Rename/Nyanbyte.DotnetTools.Rename.csproj @@ -11,4 +11,8 @@ + + + + diff --git a/src/Nyanbyte.DotnetTools.Rename/Program.cs b/src/Nyanbyte.DotnetTools.Rename/Program.cs index 0c0677c..931efd9 100644 --- a/src/Nyanbyte.DotnetTools.Rename/Program.cs +++ b/src/Nyanbyte.DotnetTools.Rename/Program.cs @@ -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(); + } } }