-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDirectory.Build.props
More file actions
177 lines (163 loc) · 8.82 KB
/
Copy pathDirectory.Build.props
File metadata and controls
177 lines (163 loc) · 8.82 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<!-- https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-reserved-and-well-known-properties?view=vs-2017 -->
<!-- EXTERNAL_PROPERTIES: MSBuildThisFileDirectory -->
<Project>
<PropertyGroup>
<Version Condition="$(Version) == ''">0.1.0.0</Version>
</PropertyGroup>
<!-- Global Coverage Exclusions -->
<PropertyGroup>
<ExcludeFromCodeCoverage>**/Migrations/**;**/obj/**;**/bin/**;**/wwwroot/**;**/node_modules/**</ExcludeFromCodeCoverage>
</PropertyGroup>
<!-- NuGet restore is deterministic within the same SDK version and feed. -->
<PropertyGroup>
<RestorePackagesWithLockFile>false</RestorePackagesWithLockFile>
</PropertyGroup>
<PropertyGroup>
<Version>$(Version)</Version>
<Authors>Michael A. Volz</Authors>
<FileVersion>$(Version)</FileVersion>
<AssemblyVersion>$(Version)</AssemblyVersion>
<Product>redmuffin.Blazor.StaticWeb</Product>
<NeutralLanguage>en</NeutralLanguage>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
</PropertyGroup>
<!--
CONFIGURATION DEFINITIONS
Define debug configurations once to avoid duplication
-->
<PropertyGroup>
<IsDebugConfiguration Condition="'$(Configuration)' == 'Debug' OR '$(Configuration)' == 'Debug-Sass'">true</IsDebugConfiguration>
<IsDebugConfiguration Condition="'$(IsDebugConfiguration)' != 'true'">false</IsDebugConfiguration>
</PropertyGroup>
<!--
BLAZOR WEBASSEMBLY OPTIMIZATIONS
These settings are split between Debug and Release configurations to optimize build performance:
- Debug: Fast builds for AI agents and development (minimal optimizations)
- Release: Full production optimizations for deployment
-->
<!-- DEBUG MODE: Fast builds for development and AI agent workflows -->
<PropertyGroup
Condition="'$(UsingMicrosoftNETSdkBlazorWebAssembly)' == 'true' AND '$(IsDebugConfiguration)' == 'true'">
<!-- Disable globalization optimizations for faster debug builds -->
<InvariantGlobalization>false</InvariantGlobalization>
<!-- Allow full resource keys for better debugging experience -->
<UseSystemResourceKeys>false</UseSystemResourceKeys>
<!-- Preserve collation data for debugging (larger bundle, but better dev experience) -->
<BlazorWebAssemblyPreserveCollationData>true</BlazorWebAssemblyPreserveCollationData>
<!-- Disable IL stripping in debug for faster compilation -->
<WasmStripILAfterAOT>false</WasmStripILAfterAOT>
</PropertyGroup>
<!-- RELEASE MODE: Full production optimizations -->
<PropertyGroup Condition="'$(UsingMicrosoftNETSdkBlazorWebAssembly)' == 'true' AND '$(Configuration)' == 'Release'">
<!-- Enable static web asset fingerprinting — SHA-256 content hashing
for cache-busting with immutable browser caching (.NET 10+) -->
<StaticWebAssetsFingerprintingEnabled>true</StaticWebAssetsFingerprintingEnabled>
<!-- Enable globalization optimizations for smaller bundle size -->
<InvariantGlobalization>true</InvariantGlobalization>
<!-- Use system resource keys to reduce bundle size -->
<UseSystemResourceKeys>true</UseSystemResourceKeys>
<!-- Remove collation data for smaller production bundle -->
<BlazorWebAssemblyPreserveCollationData>false</BlazorWebAssemblyPreserveCollationData>
<!-- IL stripping after AOT disabled - AoT is not used to keep bundle size small -->
<WasmStripILAfterAOT>false</WasmStripILAfterAOT>
<!-- Disable timezone support to reduce bundle size (application doesn't use timezones) -->
<BlazorEnableTimeZoneSupport>false</BlazorEnableTimeZoneSupport>
<!-- Disable EventSource support to reduce bundle size -->
<EventSourceSupport>false</EventSourceSupport>
<!-- Disable HTTP activity propagation (not using distributed tracing) -->
<HttpActivityPropagationSupport>false</HttpActivityPropagationSupport>
</PropertyGroup>
<!--
SECURITY AND RELIABILITY ENHANCEMENTS
Split by configuration to balance build speed vs production quality
-->
<!-- DEBUG MODE: Faster builds with minimal safety checks -->
<PropertyGroup Condition="'$(IsDebugConfiguration)' == 'true'">
<!-- Disable overflow checking for faster debug builds -->
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<!-- Disable deterministic builds for faster compilation -->
<Deterministic>false</Deterministic>
<!-- Skip reference assembly generation to speed up builds -->
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
</PropertyGroup>
<!-- RELEASE MODE: Full security and reliability checks -->
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<!-- Enable overflow checking for production safety -->
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<!-- Enable deterministic builds for reproducible releases -->
<Deterministic>true</Deterministic>
<!-- Generate reference assemblies for better tooling support -->
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
</PropertyGroup>
<!-- .NET analyzers - enabled for ALL configurations -->
<PropertyGroup>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisLevel>latest</AnalysisLevel>
<AnalysisMode>recommended</AnalysisMode>
<AnalysisModeGlobalization>None</AnalysisModeGlobalization>
<AnalysisModeSecurity>All</AnalysisModeSecurity>
<AnalysisModeReliability>All</AnalysisModeReliability>
<AnalysisModePerformance>All</AnalysisModePerformance>
</PropertyGroup>
<ItemGroup>
<Watch Include="**\*.js" Exclude="node_modules\**\*;**\*.js.map;obj\**\*;bin\**\*" />
<Watch Include="**\*.css" />
<Watch Include="appsettings*.json" />
</ItemGroup>
<PropertyGroup>
<!-- slopwatch-ignore: SW005 [MSBuild infrastructure noise: 1701/1702 binding redirects, CA1014 CLSCompliant not targeted, AD0001 analyzer crash guard] -->
<NoWarn>1701;1702;CA1014;AD0001</NoWarn>
<WarningsAsErrors>Nullable</WarningsAsErrors>
<!-- TreatWarningsAsErrors is conditionally disabled during dotnet watch
to keep the loop responsive. The ConfigureAwaitFixer plugin handles
CA2007 on agent writes. Pre-commit dotnet build enforces zero-warning
policy. dotnet watch requires the -p:TreatWarningsAsErrors=false flag
passed after the double-hyphen separator. -->
<TreatWarningsAsErrors Condition="'$(DotNetWatchBuild)' != 'true'">true</TreatWarningsAsErrors>
<LangVersion>preview</LangVersion>
</PropertyGroup>
<!-- Analyzer packages - ALL configurations (versions managed in Directory.Packages.props) -->
<ItemGroup Condition="'$(IsTestProject)' != 'true'">
<PackageReference Include="Meziantou.Analyzer">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Roslynator.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Roslynator.CodeAnalysis.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Roslynator.Formatting.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Components.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="AsyncFixer">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<!-- ConfigureAwaitFixer — auto-fixes CA2007 on dev machine (skipped on CI) -->
<ItemGroup Condition="'$(CI)' == '' AND '$(GITHUB_ACTIONS)' == '' AND '$(IsConfigureAwaitFixerProject)' != 'true'">
<PackageReference Include="redmuffin.Tools.ConfigureAwaitFixer">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>