-
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
Error log the invalid the target name #9050
Conversation
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.
Did you consider putting a IndexOfAny(XMakeElements.InvalidTargetNameCharacters)
check in the target-specification code in xmake.cs
? That might be slightly less invasive than this, while accomplishing very similar goals.
Thanks. Your suggestion way is better. I have updated that. |
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.
Looks good! Can you please add some test coverage in src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs
?
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.
Looks good
Fixes #9039
Context
It will have unhandled exception when specify a target with invalid character when building a solution.
For an individual project the error is a much cleaner, but it's still a bit misleading
Changes Made
Add invalid target name analysis in the method ProcessTargetSwitch
Testing
ProcessInvalidTargetSwitch()
Notes