Adding a command line argument for including the transitive project dependencies of the projects found in the initial scan directory#38
Conversation
…ependencies of the projects found in the initial scan directory.
| private string[] _excludePackageNamespaces { get; set; } | ||
|
|
||
| private bool _shouldIncludePackages { get; set; } | ||
| private bool _shouldIncludePackages; |
There was a problem hiding this comment.
{ get; set; } not needed on private vars.
| } | ||
| } | ||
| var directories = Directory.EnumerateDirectories(folder); | ||
| if (_shouldIncludeTransitiveProjectDependencies) |
There was a problem hiding this comment.
If the option is on, find the directory for all of the projects this project depends on, and add all of them that aren't already in the list to the list of directories to run discovery on. This lets one chase a dependency hierarchy for a single project all the way to the root through lots of directories and build a much more meaningful graph than one that just has it's projects and the single projects it depends on (when you run it focused on a single project directory in a solution for example).
| - `DependenSee \Source\SolutionFolder -ExcludeFolders "\Source\SolutionFolder\docs, Source\SolutionFolder\clientapp\node-modules"` | ||
| - `DependenSee \Source\SolutionFolder -EFol "C:\Source\SolutionFolder\docs, \Source\SolutionFolder\clientapp\node-modules"` | ||
|
|
||
| ## IncludeTransitiveProjectDependencies |
| [ArgDefaultValue(false)] | ||
| [ArgDescription("Set if you want to recusively scan all project directories of the project dependencies of the projects found in the initially scanned directory, which can produce a 'slice' through a larger solution.")] | ||
| [ArgShortcut("ITDep")] | ||
| public bool IncludeTransitiveProjectDependencies { get; set; } |
|
I'm not sure how this related to #25 as it is asking to visually isolate/filter existing output. From the implementation, I think this is similar to #34 ? Keen to see your illustrations for this one. My concern with this is that I don't want to make the tool search outside of the specified folder. User probably don't expect the tool to do it anyway. If this is required, currently there are 2 options.
There's also things like git submodules, which should be covered inder second option above. Assumption (which I'm feeling may be is broken) is that your repository is in a folder so when you load the solution in to your IDE, it should find it inside that folder. So if DependenSee is run within the repo folder, everything the IDE would see should be visible this way. I understand some projects may have setups where they rely on a directory structure outside if the repository (for whatever reason). For these my current thinking is that these scenarios are serviceable using above options. I should also mention there has been a feature almost shipped to do the discovery based on one or more I'm not sure what I'm missing here to understand your use case, so keen to see your illustration. |
|
You can classify it however you'd like, I see this as a command-line way of obtaining the kind of focus within a large solution this question was seeking. Either way, we could easily read the solution file and keep you within the solution when we add the additional directories. But remember that project references are EXTREMELY unlikely to point at something outside of the solution anyway. I don't use reparse points or symlinks in my solution, and I wouldn't add them to get an analysis tool to do what I'd like it to. There are too many folders to exclude, so that doesn't work either. Only this approach got me the diagram I needed. I'll post some redacted diagrams in a bit to illustrate. |
|
Is there some way I can send these diagrams to you privately @madushans? I want to include the diagram of my entire solution for context, but it's impractical for me to redact that so it can be posted here. Email maybe? |
|
I think I get the end goal. You have a large solution where you want discovery to be done based on a given project, rather than seeing all the projects in the folder/solution. So if you have the below graph. And you're "focusing" on Since you're only focusing on downstream dependencies, and don't want to see what's "above" that level. Currently the only way to do this is to exclude all the other projects, which is not practical. (Exclusion was implemented for scenarios like excluding test projects .etc.) So I see a use for this in large solutions and/or mono repos. Let me have a think about what the best approach for this can be. Command line arguments are already getting a bit out of hand, so I don't want to build too many of them that might make things hard to maintain down the road. Currently your solution is to have something like this
I'm still against the tool searching outside what's provided in the
e,g: This way IMO the experience is a bit better.
We should also be able to accept multiple projects in this new switch, if we want to do the discovery from multiple locations of the graph. We could also accept just a folder, instead of a project file, which might be better. I think vis.js can handle multiple "islands" in the visualization, so things should be ok in that side. I think this will not conflict with other switches, but give me some time to sleep on it, to see if I miss something. |
|
A bit of a revive, But some of the assumptions made here change when you consider that some references aren't projects in your solution/folder/control or even projects - they are NuGets. |
Let me know if it's unclear what this does, I can post some diagrams to illustrate if so.