-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Static Graph] ProjectGraph.GetTargetLists throws on invalid target names #4599
Conversation
7cb8cba
to
bdad502
Compare
bdad502
to
3e0fe7e
Compare
} | ||
|
||
[Fact] | ||
public void GetTargetListsReturnsEmptyTargetsForAllNodesWhenDefaultTargetsAreRequestedAndThereAreNoDefaultTargets() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Under what circumstance are there no default targets? Doesn't MSBuild always have a default target (if none is explicitly listed, it's the first one defined in the logical project)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The project file has no targets. Added a comment on it.
|
||
if (targetNames.Any(targetName => string.IsNullOrWhiteSpace(targetName))) | ||
{ | ||
throw new ArgumentException(ResourceUtilities.FormatResourceStringIgnoreCodeAndKeyword("OM_TargetNameNullOrEmpty", nameof(GetTargetLists))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this enough context? I was thinking more along the lines of "what project caused this error?"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that's a bit harder to answer. There is no actual project here. These targets are the graph wide targets the whole graph needs to be built with. The closest thing for identification would be the set of graph roots
Just cleanup: clarifying some documentation, validating some inputs, avoiding needless iterations.