Skip to content

Conversation

@HandyS11
Copy link
Contributor

This pull request adds support for pruning redundant project references starting from either a solution file (.sln/.slnx) or a single .csproj file, improves input validation, and refactors the code for better modularity and maintainability. It also introduces more robust dependency graph reporting, including Markdown output with Mermaid diagrams.

Support for both solution and project file inputs:

  • The PruneLinks command now accepts either a solution file (--solution) or a project file (--csproj) as input, with validation to ensure only one is specified at a time. This allows pruning references for standalone projects as well as solutions. [1] [2]

Dependency graph and reporting improvements:

  • Added Markdown output for the dependency graph using Mermaid syntax, with correct handling for both solution and project roots. The output file location can be specified, and the graph is generated using the new GraphMarkdownUtil.GenerateMermaidMarkdown utility.
  • Enhanced verbose mode to display reference trees for each root project, using a refactored PrintReferenceTree method. [1] [2]

Refactoring and modularization:

  • Moved project reference tree printing logic and project collection logic into new methods in ProjectManipulator, including CollectAllReferencedProjects and PrintReferenceTree, improving code reuse and readability.
  • Improved solution file parsing in SolutionFileParser to support both .sln and .slnx formats, with documentation and more robust project element discovery. [1] [2] [3]

@HandyS11
Copy link
Contributor Author

Hi,

I'm wondering if adding the markdown file generation inside the "prunelinks" command itself isn't too much.
I feel it needs a separated command with more options dedicated.
I have struggle to find an easy way to build package diagrams in .net (other than doing it by hand) and this is the "easier" way I found.

Let me know if you have idea on this, I thing this can be really helpfull to understand the dependencies on big projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant