-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDirectory.Build.targets
More file actions
37 lines (31 loc) · 2.54 KB
/
Copy pathDirectory.Build.targets
File metadata and controls
37 lines (31 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<Project>
<!--
Local Debug builds skip BUILD-TIME analyzer execution. Release does not, and the IDE keeps its squiggles.
Directory.Build.props sets AnalysisMode=All + EnforceCodeStyleInBuild=true and adds Analyzer to every
project (Meziantou + BannedApiAnalyzers to production ones). That rule density is applied to ~350k lines
including XE-Local-AI-Engine.Tests, and analyzer execution dominates Csc time on a build of that shape — a
cost the inner dev loop pays on every iteration for feedback that the gate does not actually depend on.
Release keeps the full strict wall, and Release is what every gate builds: the AGENTS.md validation commands
and publish/package-tester-win.ps1 both build in Release configuration.
So the S1135 "no bare TODO/FIXME" rule, the banned-API wall and the Sonar rules still fail the build before
anything ships — they just no longer fail a local `dotnet build` that specifies no configuration.
This must live in Directory.Build.targets, NOT Directory.Build.props: Microsoft.Common.props imports
Directory.Build.props BEFORE it defaults $(Configuration), so a Configuration condition evaluated there sees
an empty string and silently misfires in both directions.
Safety notes:
- RunAnalyzersDuringBuild=false is the build-time-only knob: it makes the build pass csc -skipanalyzers,
which skips diagnostic analyzers only. Source generators still run, so TUnit test discovery is
unaffected (a silent zero-test run is the failure mode this repo has already paid for once — see
docs/agent-knowledge.md). RunAnalyzers=false, which this property replaced, was the master switch: it
also disabled RunAnalyzersDuringLiveAnalysis, so Rider and Visual Studio showed no analyzer squiggles
at all while editing. That side effect was never wanted. RunAnalyzersDuringLiveAnalysis is left unset
and therefore stays at its default of true. Property table: Microsoft Learn, "Disable source code
analysis for .NET" (https://learn.microsoft.com/visualstudio/code-quality/disable-code-analysis).
- TreatWarningsAsErrors stays on, so genuine compiler warnings still fail a Debug build.
- Set XE_FULL_ANALYSIS=1 to force the full analyzer pass in Debug, and $(CI) is honoured so any automated
build gets it regardless of configuration.
-->
<PropertyGroup Condition="'$(Configuration)' == 'Debug' And '$(CI)' == '' And '$(XE_FULL_ANALYSIS)' == ''">
<RunAnalyzersDuringBuild>false</RunAnalyzersDuringBuild>
</PropertyGroup>
</Project>