Skip to content

Commit

Permalink
fix sln gen tool
Browse files Browse the repository at this point in the history
  • Loading branch information
thepirat000 committed Jan 19, 2025
1 parent 07d9ea5 commit 33016c9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions tools/SolutionGenerator/SolutionGenerator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,27 @@ static void Main(string[] args)
.Where(p => IncludeProject(p, filters))
.ToList();

if (projects.Count == 1)
{
Console.WriteLine("No projects found");

return;
}

var includedProjects = new HashSet<string>(projects.Select(p => p.pGuid));

foreach (var projectGuid in sln.Result.ProjectDependencies.Dependencies.Keys.Where(k => !includedProjects.Contains(k)))
{
sln.Result.ProjectDependencies.Dependencies.Remove(projectGuid);
sln.Result.ProjectDependencies.GuidList.Remove(projectGuid);
sln.Result.ProjectDependencies.Projects.Remove(projectGuid);
}

Console.WriteLine();
for (int i = 0; i < projects.Count; i++)
{
Console.WriteLine($"Adding {projects[i].name}");

// Replace relative path with full path
projects[i] = projects[i] with { path = projects[i].fullPath };
}
Expand All @@ -50,6 +68,7 @@ static void Main(string[] args)
var handlers = new Dictionary<Type, HandlerValue>()
{
[typeof(LProject)] = new(new WProject(projects, sln.Result.ProjectDependencies)),
[typeof(LNestedProjects)] = new(new WNestedProjects(sln.Result.SolutionFolders, projects))
};

using var w = new SlnWriter(outputSlnPath, handlers);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"profiles": {
"SolutionGenerator": {
"commandName": "Project",
"commandLineArgs": "\"D:\\MIOS\\Proyectos .NET\\Audit.NET\\Audit.NET.sln\" \"\" \"Audit.NET.modified.sln\""
"commandLineArgs": "\"D:\\MIOS\\Proyectos .NET\\Audit.NET\\Audit.NET.sln\" \"polly\" \"Audit.NET.modified.sln\""
}
}
}

0 comments on commit 33016c9

Please sign in to comment.