Skip to content

chore: Optimize build by disabling analyzers for local Debug#22966

Open
morning4coffe-dev wants to merge 1 commit intomasterfrom
dev/doti/local-build-perf
Open

chore: Optimize build by disabling analyzers for local Debug#22966
morning4coffe-dev wants to merge 1 commit intomasterfrom
dev/doti/local-build-perf

Conversation

@morning4coffe-dev
Copy link
Copy Markdown
Member

GitHub Issue: closes #

PR Type:

  • 🏗️ Build or CI related changes

What is the current behavior? 🤔

What is the new behavior? 🚀

PR Checklist ✅

Please check if your PR fulfills the following requirements:

Other information ℹ️

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ReportAnalyzer and EnforceCodeStyleInBuild during optimized local Debug builds to reduce compilation overhead.
  • Update crosstargeting_override.props.sample documentation to describe the optimization knobs and add RunAnalyzersDuringLiveAnalysis as 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.

Comment thread src/Directory.Build.props
Comment on lines 14 to +18
<PropertyGroup Condition="'$(UNO_DISABLE_ANALYZERS_IN_SAMPLES)' == 'true' and '$(UnoDisableAnalyzersForSamples)'=='true'">
<UnoDisableNetAnalyzers>true</UnoDisableNetAnalyzers>
<RunAnalyzersDuringBuild>false</RunAnalyzersDuringBuild>
<RunAnalyzersDuringAnalysis>false</RunAnalyzersDuringAnalysis>
<RunAnalyzersDuringLiveAnalysis>false</RunAnalyzersDuringLiveAnalysis>
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Comment thread src/crosstargeting_override.props.sample
Comment thread src/Directory.Build.props
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>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants