-
Notifications
You must be signed in to change notification settings - Fork 396
Add ruleset as input to fast up to date #2464
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
Conversation
Can we instead make a change to designtime.targets to add: <UpToDateCheckInputFile Include="@(CodeAnalysisRuleSet)" /> and avoid special casing in the PS? |
Was just about to ask exactly the same thing... |
It seems a little funny to be putting non-designtime stuff into a targets named "designtime," but sure... |
@@ -282,6 +283,7 @@ private HashSet<string> CollectInputs(Logger logger) | |||
var inputs = new HashSet<string>(); | |||
|
|||
AddInput(logger, inputs, _msBuildProjectFullPath, "project file"); | |||
|
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.
whitespace
@@ -25,6 +25,11 @@ | |||
<SuppressOutOfDateMessageOnBuild Condition="'$(SuppressOutOfDateMessageOnBuild)' == ''">true</SuppressOutOfDateMessageOnBuild> | |||
</PropertyGroup> | |||
|
|||
<!-- If the project we're compiling has a ruleset, make sure we check it for up-to-date checks. --> | |||
<ItemGroup Condition="'$(CodeAnalysisRuleSet)' != ''"> |
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.
Make sure to verify that this doesn't do anything wonky in the old PS (the designtime targets are imported by non-SDK projects as well).
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.
It doesn't look like the old PS took rulesets into account for fast up to date, so this will add it there, too. I'll check to make sure it doesn't change anything, but I assume it's OK to extend the old PS as well?
Tagging @MattGertz for Preview4 |
"DesignTime" == "things needed to make VisualStudio work". |
'When I use a word,' Humpty Dumpty said, in rather a scornful tone, 'it means just what I choose it to mean — neither more nor less.' |
:-) |
Customer scenario
The user's SDK-based project uses a ruleset as input to project analyzers. The user changes the ruleset to include rules that would cause the project to no longer build due to new errors. The user builds but because we didn't take into account the change to the ruleset, we think the project is up to date and the build is incorrectly successful.
Bugs this fixes:
Fixes #2374
Workarounds, if any
User would have to perform a rebuild.
Risk
Low, this just adds a new file into the up to date check. Biggest risk is that we would think a project was not up to date when it was, resulting in calling MSBuild.
Performance impact
Low, looks at one additional file.
Is this a regression from a previous update?
No.