chore: Optimize build by disabling analyzers for local Debug#22966
chore: Optimize build by disabling analyzers for local Debug#22966morning4coffe-dev wants to merge 1 commit intomasterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Optimizes local iteration by disabling costly analyzer and code-style enforcement during Debug builds when an opt-in build flag is enabled.
Changes:
- Add an
OptimizeImplicitlyTriggeredBuild-gated Debug-only property group to disable analyzers/code-style enforcement during builds. - Disable
ReportAnalyzerandEnforceCodeStyleInBuildduring optimized local Debug builds to reduce compilation overhead. - Update
crosstargeting_override.props.sampledocumentation to describe the optimization knobs and addRunAnalyzersDuringLiveAnalysisas an optional local setting.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/Directory.Build.targets | Adds Debug-only optimized-build property group and extends sample-project analyzer disabling to include live analysis. |
| src/Directory.Build.props | Makes ReportAnalyzer and EnforceCodeStyleInBuild conditional to avoid overhead in optimized local Debug builds. |
| src/crosstargeting_override.props.sample | Documents the optimization flags and adds a commented opt-in for disabling live analysis. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <PropertyGroup Condition="'$(UNO_DISABLE_ANALYZERS_IN_SAMPLES)' == 'true' and '$(UnoDisableAnalyzersForSamples)'=='true'"> | ||
| <UnoDisableNetAnalyzers>true</UnoDisableNetAnalyzers> | ||
| <RunAnalyzersDuringBuild>false</RunAnalyzersDuringBuild> | ||
| <RunAnalyzersDuringAnalysis>false</RunAnalyzersDuringAnalysis> | ||
| <RunAnalyzersDuringLiveAnalysis>false</RunAnalyzersDuringLiveAnalysis> |
There was a problem hiding this comment.
This block is documented as “Disable analyzers … to improve build performance”, but it now also sets RunAnalyzersDuringLiveAnalysis=false, which affects IDE live analysis (not just build-time analyzers). Please update the comment to reflect that IDE live analyzer diagnostics are also disabled under this condition (or move RunAnalyzersDuringLiveAnalysis behind a separate opt-in flag if that’s not intended).
| EnforceCodeStyleInBuild runs Roslyn code-style analyzers during build. | ||
| Disable during optimized local builds; the IDE still catches style violations. | ||
| --> | ||
| <EnforceCodeStyleInBuild Condition="'$(OptimizeImplicitlyTriggeredBuild)' != 'true' or '$(Configuration)' != 'Debug'">true</EnforceCodeStyleInBuild> |
There was a problem hiding this comment.
OptimizeImplicitlyTriggeredBuild is true in IDE for scenarios like running tests or start debugger, and if it's true, then all analyzers are disabled either way. Is this line really doing anything?
GitHub Issue: closes #
PR Type:
What is the current behavior? 🤔
What is the new behavior? 🚀
PR Checklist ✅
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Runresults.Other information ℹ️