-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSQLTriage.csproj
More file actions
414 lines (386 loc) · 28.2 KB
/
SQLTriage.csproj
File metadata and controls
414 lines (386 loc) · 28.2 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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
<OutputType>WinExe</OutputType>
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
<DefaultItemExcludes>$(DefaultItemExcludes);PerformanceMonitor-main\**;PerformanceMonitor_db\**;Tests\**;BenchmarkSuite1\**;Data\DashboardPreloaderService.cs;Data\OptimizedDashboardLoader.cs;publish\**;release\**;lib\**;BPScripts\Ignore\**</DefaultItemExcludes>
<NoWarn>$(NoWarn);CS0169;CS0414;BL0007</NoWarn>
<RootNamespace>SQLTriage</RootNamespace>
<AssemblyName>SQLTriage</AssemblyName>
<Product>SQLTriage</Product>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<PlatformTarget>x64</PlatformTarget>
<PublishSingleFile>false</PublishSingleFile>
<Platforms>AnyCPU;x64</Platforms>
<!-- Only include English satellite resource assemblies � prevents NuGet packages from copying 14+ language folders -->
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
<ApplicationIcon>SQLTriage.ico</ApplicationIcon>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Title>SQLTriage</Title>
<Authors>Adrian Sullivn</Authors>
<Description>An Enterprise grade SQL health check assessment tool. This tool will generate diagnostic outputs for a comprehensive SQL health audit. Incorporating SQLWATCH for database metrics.</Description>
<Copyright>Adrian Sullivan</Copyright>
<PackageProjectUrl>https://github.com/SQLAdrian/SQLTriage</PackageProjectUrl>
<PackageIcon>SQLTriage.png</PackageIcon>
<RepositoryUrl>https://github.com/SQLAdrian/SQLTriage</RepositoryUrl>
<RepositoryType>GIthub</RepositoryType>
<!-- Memory Optimization: Server GC for better throughput, concurrent for lower latency -->
<ServerGarbageCollection>true</ServerGarbageCollection>
<ConcurrentGarbageCollection>true</ConcurrentGarbageCollection>
<!-- Windows-only: Exclude non-Windows runtimes -->
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<!-- Disable Blazor hot-reload to suppress _wpftmp.csproj side-project generation -->
<RazorHotReload>false</RazorHotReload>
<!-- Work around _wpftmp.csproj Razor source generator NullReferenceException.
The WPF temp project cannot run the Razor source generator; skip Razor compilation
for the temp project only. The main project handles Razor normally. -->
<EnableDefaultRazorGenerateItems Condition="$(MSBuildProjectFile.Contains('_wpftmp'))">false</EnableDefaultRazorGenerateItems>
<!-- Suppress duplicate AssemblyInfo attributes in the WPF hot-reload temp project -->
<GenerateAssemblyInfo Condition="$(MSBuildProjectFile.Contains('_wpftmp'))">false</GenerateAssemblyInfo>
<GenerateTargetFrameworkAttribute Condition="$(MSBuildProjectFile.Contains('_wpftmp'))">false</GenerateTargetFrameworkAttribute>
<!-- Suppress Razor compilation in the WPF hot-reload temp project -->
<RazorCompileOnBuild Condition="$(MSBuildProjectFile.Contains('_wpftmp'))">false</RazorCompileOnBuild>
<RazorCompileOnPublish Condition="$(MSBuildProjectFile.Contains('_wpftmp'))">false</RazorCompileOnPublish>
<!-- Suppress the Razor SDK's duplicate AssemblyInfo generation � standard .NET SDK handles this -->
<GenerateRazorTargetAssemblyInfo>false</GenerateRazorTargetAssemblyInfo>
<!-- Custom entry point: Program.Main handles both WPF and service modes -->
<StartupObject>SQLTriage.Program</StartupObject>
</PropertyGroup>
<!-- ASP.NET Core framework for Blazor Server mode (Kestrel, SignalR) -->
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<!-- Exclude orphaned scratch projects and research artefacts from compilation -->
<ItemGroup>
<Compile Remove="CheckValidator\**" />
<Content Remove="CheckValidator\**" />
<EmbeddedResource Remove="CheckValidator\**" />
<None Remove="CheckValidator\**" />
<Compile Remove="CheckMerger\**" />
<Content Remove="CheckMerger\**" />
<EmbeddedResource Remove="CheckMerger\**" />
<None Remove="CheckMerger\**" />
<!-- research_output: never built, tested, published, or copied to bin -->
<Compile Remove="research_output\**" />
<Content Remove="research_output\**" />
<EmbeddedResource Remove="research_output\**" />
<None Remove="research_output\**" />
<Compile Remove="research_logs\**" />
<Content Remove="research_logs\**" />
<EmbeddedResource Remove="research_logs\**" />
<None Remove="research_logs\**" />
</ItemGroup>
<!-- Release Build Optimizations -->
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<PublishReadyToRun>true</PublishReadyToRun>
<PublishReadyToRunShowWarnings>true</PublishReadyToRunShowWarnings>
<DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols>
<Optimize>true</Optimize>
<SelfContained>true</SelfContained>
<PublishSingleFile>true</PublishSingleFile>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
<PublishTrimmed>false</PublishTrimmed>
</PropertyGroup>
<ItemGroup>
<Content Remove="SqlWatch.Monitor\**" />
<Content Remove="PerformanceMonitor-main\**" />
</ItemGroup>
<ItemGroup>
<Compile Remove="SqlWatch.Monitor\**" />
<Compile Remove="Tests\**" />
<Compile Remove="BenchmarkSuite1\**" />
<Compile Remove="Release\**" />
<Compile Remove="PerformanceMonitor-main\**" />
<Compile Remove="Config\Ignore\**" />
<Compile Remove="Data\Services\Analysis\**" />
<EmbeddedResource Remove="SqlWatch.Monitor\**" />
<EmbeddedResource Remove="Tests\**" />
<EmbeddedResource Remove="BenchmarkSuite1\**" />
<EmbeddedResource Remove="Release\**" />
<EmbeddedResource Remove="PerformanceMonitor-main\**" />
<None Remove="SqlWatch.Monitor\**" />
<None Remove="Tests\**" />
<None Remove="BenchmarkSuite1\**" />
<None Remove="Release\**" />
<None Remove="PerformanceMonitor-main\**" />
</ItemGroup>
<!-- Include Deploy folder in publish output for database scripts -->
<ItemGroup>
<Content Include="Deploy\**" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest" />
<!-- Config\*.json files are auto-included by the SDK (Config is not in DefaultItemExcludes).
TargetPath for each is set via Content Update entries below. -->
<Content Remove="Config\Ignore\**" />
<Content Remove="Config\*.backup" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MailKit" Version="4.16.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Google" Version="8.0.*" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.MicrosoftAccount" Version="8.0.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Wpf" Version="8.0.*" />
<PackageReference Include="Microsoft.SqlServer.DacFx" Version="162.*" />
<PackageReference Include="Blazor-ApexCharts" Version="3.*" />
<PackageReference Include="Radzen.Blazor" Version="5.*" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="6.*" />
<PackageReference Include="Microsoft.SqlServer.Management.Assessment" Version="1.*" />
<PackageReference Include="Microsoft.SqlServer.SqlManagementObjects" Version="172.*" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="8.0.*">
<ExcludeAssets>runtimes</ExcludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.*" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.*" />
<PackageReference Include="Polly" Version="8.4.2" />
<PackageReference Include="Serilog" Version="4.*" />
<PackageReference Include="Serilog.Extensions.Logging" Version="8.*" />
<PackageReference Include="Serilog.Sinks.File" Version="6.*" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.*" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.*" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.*" />
<PackageReference Include="QuestPDF" Version="2024.10.4" />
<PackageReference Include="MessagePack" Version="2.5.187" />
<PackageReference Include="Konscious.Security.Cryptography.Argon2" Version="1.3.1" />
</ItemGroup>
<ItemGroup>
<Content Update="Config\ruleset.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>config/ruleset.json</TargetPath>
</Content>
<Content Update="Config\sql-checks.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>config/sql-checks.json</TargetPath>
</Content>
<Content Update="Config\script-configurations.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>config/script-configurations.json</TargetPath>
</Content>
<Content Update="Config\user-settings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>config/user-settings.json</TargetPath>
</Content>
<Content Update="Config\alert-definitions.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>config/alert-definitions.json</TargetPath>
</Content>
<Content Update="Config\scheduled-tasks.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>config/scheduled-tasks.json</TargetPath>
</Content>
<Content Update="Config\appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>config/appsettings.json</TargetPath>
</Content>
<Content Update="Config\appsettings.Production.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>config/appsettings.Production.json</TargetPath>
</Content>
<Content Update="Config\appsettings.Development.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>config/appsettings.Development.json</TargetPath>
</Content>
<Content Update="Config\version.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>config/version.json</TargetPath>
</Content>
<Content Update="Config\dashboard-config.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>config/dashboard-config.json</TargetPath>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="SQLTriage.ico" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<ItemGroup>
<None Remove="BPScripts\Ignore\**" />
<Content Remove="BPScripts\Ignore\**" />
<None Update="BPScripts\01. MaintenanceSolution.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="BPScripts\02. Post implementation configuration script - The Piranha Interceptor Destroyer.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="BPScripts\03. dba quick view.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="BPScripts\09. Do Stats.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="BPScripts\AddTraceflags.ps1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="BPScripts\availibility group job step script replica check.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="BPScripts\doSPNs.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="BPScripts\find indexes to drop.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="BPScripts\Firewall rules with PowerShell.ps1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="BPScripts\Install-All-Scripts.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="BPScripts\shrinkfile -gradual.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="BPScripts\WeeklyReportSchedule.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="scripts\Check_BP_Servers.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="scripts\sp_Blitz.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="scripts\SQLDBA.ORG.sp_triage.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="scripts\stpChecklist_Seguranca.sql">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="SQLTriage.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="Deploy\**\*.*">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<!-- Config files are included via Content Include="Config\*.json" above.
Do NOT re-declare them as None � that overrides Content and breaks publish. -->
<ItemGroup>
<Resource Include="SQLTriage.png" />
</ItemGroup>
<!-- Organize build output: DLLs to bin/, JSON configs to config/ -->
<Target Name="OrganizeBuildOutput" AfterTargets="Build" Condition="'$(PublishDir)' == ''">
<ItemGroup>
<DllFiles Include="$(OutputPath)*.dll" Exclude="$(OutputPath)SQLTriage.dll" />
<ConfigFiles Include="$(OutputPath)appsettings*.json" />
<ConfigFiles Include="$(OutputPath)dashboard-config.json" Condition="Exists('$(OutputPath)dashboard-config.json')" />
<ConfigFiles Include="$(OutputPath)version.json" Condition="Exists('$(OutputPath)version.json')" />
<ConfigFiles Include="$(OutputPath)script-configurations.json" Condition="Exists('$(OutputPath)script-configurations.json')" />
<ConfigFiles Include="$(OutputPath)sql-checks.json" Condition="Exists('$(OutputPath)sql-checks.json')" />
<ConfigFiles Include="$(OutputPath)user-settings.json" Condition="Exists('$(OutputPath)user-settings.json')" />
<ConfigFiles Include="$(OutputPath)SQLTriage.*.json" />
</ItemGroup>
<MakeDir Directories="$(OutputPath)bin" />
<MakeDir Directories="$(OutputPath)config" />
<Move SourceFiles="@(DllFiles)" DestinationFolder="$(OutputPath)bin" />
<Move SourceFiles="@(ConfigFiles)" DestinationFolder="$(OutputPath)config" />
</Target>
<!-- Remove language folders from publish output -->
<Target Name="RemoveLanguageFolders" AfterTargets="Publish" Condition="'$(PublishDir)' != ''">
<ItemGroup>
<LanguageFolders Include="$(PublishDir)cs;$(PublishDir)de;$(PublishDir)es;$(PublishDir)fr;$(PublishDir)it;$(PublishDir)ja;$(PublishDir)ko;$(PublishDir)pl;$(PublishDir)pt;$(PublishDir)pt-BR;$(PublishDir)ru;$(PublishDir)tr;$(PublishDir)zh-Hans;$(PublishDir)zh-Hant" />
</ItemGroup>
<RemoveDir Directories="@(LanguageFolders)" ContinueOnError="true" />
</Target>
<!-- Remove non-English language resources to reduce size -->
<Target Name="RemoveUnnecessaryLanguageResources" AfterTargets="Build">
<ItemGroup>
<LanguageFolders Include="$(OutputPath)cs;$(OutputPath)de;$(OutputPath)es;$(OutputPath)fr;$(OutputPath)it;$(OutputPath)ja;$(OutputPath)ko;$(OutputPath)pl;$(OutputPath)pt;$(OutputPath)pt-BR;$(OutputPath)ru;$(OutputPath)tr;$(OutputPath)zh-Hans;$(OutputPath)zh-Hant" />
</ItemGroup>
<RemoveDir Directories="@(LanguageFolders)" ContinueOnError="true" />
</Target>
<!-- Increment build number on every build -->
<Target Name="IncrementBuildNumber" BeforeTargets="BeforeBuild">
<Exec Command="powershell -ExecutionPolicy Bypass -File increment-build.ps1" />
</Target>
<!-- Stamp exe file version from Config\version.json on every build -->
<Target Name="StampVersionFromJson" AfterTargets="IncrementBuildNumber">
<PropertyGroup>
<VersionJson>$([System.IO.File]::ReadAllText('Config\version.json'))</VersionJson>
<VersionNumber>$([System.Text.RegularExpressions.Regex]::Match($(VersionJson), '"version"\s*:\s*"([^"]+)"').Groups[1].Value)</VersionNumber>
<BuildNumber>$([System.Text.RegularExpressions.Regex]::Match($(VersionJson), '"buildNumber"\s*:\s*(\d+)').Groups[1].Value)</BuildNumber>
<Version>$(VersionNumber).$(BuildNumber)</Version>
<AssemblyVersion>$(VersionNumber).$(BuildNumber)</AssemblyVersion>
<FileVersion>$(VersionNumber).$(BuildNumber)</FileVersion>
<InformationalVersion>v$(VersionNumber) build $(BuildNumber)</InformationalVersion>
</PropertyGroup>
<Message Importance="high" Text="Version stamped: $(FileVersion)" />
</Target>
<!-- Create release ZIP after publish -->
<Target Name="CreateReleaseZip" AfterTargets="Publish" Condition="'$(Configuration)' == 'Release' AND '$(PublishDir)' != ''">
<PropertyGroup>
<VersionJson>$([System.IO.File]::ReadAllText('Config\version.json'))</VersionJson>
<VersionNumber>$([System.Text.RegularExpressions.Regex]::Match($(VersionJson), '"version"\s*:\s*"([^"]+)"').Groups[1].Value)</VersionNumber>
<BuildNumber>$([System.Text.RegularExpressions.Regex]::Match($(VersionJson), '"buildNumber"\s*:\s*(\d+)').Groups[1].Value)</BuildNumber>
<ReleaseDir>release</ReleaseDir>
<ZipFileName>SQLTriage-v$(VersionNumber)-build$(BuildNumber)-win-x64.zip</ZipFileName>
<ZipFilePath>$(ReleaseDir)\$(ZipFileName)</ZipFilePath>
</PropertyGroup>
<RemoveDir Directories="$(PublishDir)bin" ContinueOnError="true" />
<!-- Strip dev/research artefacts that must never ship in a release -->
<RemoveDir Directories="$(PublishDir)BPScripts\Ignore" ContinueOnError="true" />
<RemoveDir Directories="$(PublishDir)research_output" ContinueOnError="true" />
<RemoveDir Directories="$(PublishDir)research_logs" ContinueOnError="true" />
<RemoveDir Directories="$(PublishDir)temp" ContinueOnError="true" />
<RemoveDir Directories="$(PublishDir)win-x64" ContinueOnError="true" />
<RemoveDir Directories="$(PublishDir).git" ContinueOnError="true" />
<!-- Strip test/coverage infrastructure that leaks in from SQLTriage.Tests -->
<RemoveDir Directories="$(PublishDir)CodeCoverage" ContinueOnError="true" />
<RemoveDir Directories="$(PublishDir)InstrumentationEngine" ContinueOnError="true" />
<!-- coverlet + code coverage -->
<Delete Files="$(PublishDir)coverlet.collector.dll;$(PublishDir)coverlet.collector.pdb;$(PublishDir)coverlet.collector.deps.json;$(PublishDir)coverlet.collector.targets;$(PublishDir)coverlet.core.dll;$(PublishDir)coverlet.core.pdb" ContinueOnError="true" />
<Delete Files="$(PublishDir)Microsoft.CodeCoverage.Core.dll;$(PublishDir)Microsoft.CodeCoverage.Instrumentation.dll;$(PublishDir)Microsoft.CodeCoverage.Interprocess.dll;$(PublishDir)Microsoft.CodeCoverage.props;$(PublishDir)Microsoft.CodeCoverage.targets" ContinueOnError="true" />
<Delete Files="$(PublishDir)Microsoft.VisualStudio.CodeCoverage.Shim.dll;$(PublishDir)Microsoft.VisualStudio.TraceDataCollector.dll" ContinueOnError="true" />
<!-- xunit + test platform -->
<Delete Files="$(PublishDir)xunit.abstractions.dll;$(PublishDir)xunit.assert.dll;$(PublishDir)xunit.core.dll;$(PublishDir)xunit.execution.dotnet.dll" ContinueOnError="true" />
<Delete Files="$(PublishDir)xunit.runner.reporters.netcoreapp10.dll;$(PublishDir)xunit.runner.utility.netcoreapp10.dll;$(PublishDir)xunit.runner.visualstudio.dotnetcore.testadapter.dll" ContinueOnError="true" />
<Delete Files="$(PublishDir)testhost.dll;$(PublishDir)testhost.exe" ContinueOnError="true" />
<Delete Files="$(PublishDir)Microsoft.TestPlatform.CommunicationUtilities.dll;$(PublishDir)Microsoft.TestPlatform.CoreUtilities.dll;$(PublishDir)Microsoft.TestPlatform.CrossPlatEngine.dll;$(PublishDir)Microsoft.TestPlatform.PlatformAbstractions.dll;$(PublishDir)Microsoft.TestPlatform.Utilities.dll" ContinueOnError="true" />
<Delete Files="$(PublishDir)Microsoft.VisualStudio.TestPlatform.Common.dll;$(PublishDir)Microsoft.VisualStudio.TestPlatform.ObjectModel.dll" ContinueOnError="true" />
<!-- test project outputs -->
<Delete Files="$(PublishDir)SQLTriage.Tests.dll;$(PublishDir)SQLTriage.Tests.pdb;$(PublishDir)SQLTriage.Tests.deps.json;$(PublishDir)SQLTriage.Tests.runtimeconfig.json" ContinueOnError="true" />
<MakeDir Directories="$(ReleaseDir)" />
<ZipDirectory SourceDirectory="$(PublishDir)" DestinationFile="$(ZipFilePath)" Overwrite="true" />
<Message Importance="high" Text="Release ZIP created: $(ZipFilePath)" />
</Target>
<!-- Build Inno Setup installer and convert screenshots after ZIP is created -->
<Target Name="BuildInstaller" AfterTargets="CreateReleaseZip" Condition="'$(Configuration)' == 'Release'">
<PropertyGroup>
<IsccExe Condition="Exists('C:\GitHub\Inno Setup 6\iscc.exe')">C:\GitHub\Inno Setup 6\iscc.exe</IsccExe>
<IsccExe Condition="'$(IsccExe)' == '' AND Exists('C:\Program Files (x86)\Inno Setup 6\iscc.exe')">C:\Program Files (x86)\Inno Setup 6\iscc.exe</IsccExe>
<IsccExe Condition="'$(IsccExe)' == '' AND Exists('C:\Program Files\Inno Setup 6\iscc.exe')">C:\Program Files\Inno Setup 6\iscc.exe</IsccExe>
<FfmpegExe Condition="Exists('C:\GitHub\TranscriptExtractor\ffmpeg.exe')">C:\GitHub\TranscriptExtractor\ffmpeg.exe</FfmpegExe>
<ScreenshotSrc>$(MSBuildProjectDirectory)\docs\screenshots\src</ScreenshotSrc>
<ScreenshotOut>$(MSBuildProjectDirectory)\docs\screenshots</ScreenshotOut>
</PropertyGroup>
<!-- Generate installer\version.iss with current version/build so iscc doesn't need to parse JSON -->
<!-- Use a separate ps1 file rather than inline -Command so we don't fight MSBuild $-property expansion. -->
<Exec Command="powershell -ExecutionPolicy Bypass -File "$(MSBuildProjectDirectory)\installer\write-version-iss.ps1"" Condition="'$(IsccExe)' != ''" ContinueOnError="true" />
<!-- Inno Setup installer -->
<Message Importance="high" Text="Building Inno Setup installer..." Condition="'$(IsccExe)' != ''" />
<Exec Command=""$(IsccExe)" installer\SQLTriage.iss" Condition="'$(IsccExe)' != ''" ContinueOnError="true" />
<Message Importance="high" Text="iscc.exe not found � skipping installer build" Condition="'$(IsccExe)' == ''" />
<!-- Convert source screenshots to web-ready JPEGs (1280px wide, q:v 4) -->
<Message Importance="high" Text="Converting screenshots for GitHub Pages..." Condition="'$(FfmpegExe)' != '' AND Exists('$(ScreenshotSrc)')" />
<Exec Command=""$(FfmpegExe)" -y -i "$(ScreenshotSrc)\1-addserver.jpg" -vf scale=1280:-1 -q:v 4 "$(ScreenshotOut)\1-addserver.jpg"" Condition="'$(FfmpegExe)' != '' AND Exists('$(ScreenshotSrc)\1-addserver.jpg')" ContinueOnError="true" />
<Exec Command=""$(FfmpegExe)" -y -i "$(ScreenshotSrc)\2-whats-new.jpg" -vf scale=1280:-1 -q:v 4 "$(ScreenshotOut)\2-whats-new.jpg"" Condition="'$(FfmpegExe)' != '' AND Exists('$(ScreenshotSrc)\2-whats-new.jpg')" ContinueOnError="true" />
<Exec Command=""$(FfmpegExe)" -y -i "$(ScreenshotSrc)\3-wait-state.jpg" -vf scale=1280:-1 -q:v 4 "$(ScreenshotOut)\3-wait-state.jpg"" Condition="'$(FfmpegExe)' != '' AND Exists('$(ScreenshotSrc)\3-wait-state.jpg')" ContinueOnError="true" />
<Exec Command=""$(FfmpegExe)" -y -i "$(ScreenshotSrc)\4-live-sessions.jpg" -vf scale=1280:-1 -q:v 4 "$(ScreenshotOut)\4-live-sessions.jpg"" Condition="'$(FfmpegExe)' != '' AND Exists('$(ScreenshotSrc)\4-live-sessions.jpg')" ContinueOnError="true" />
<Exec Command=""$(FfmpegExe)" -y -i "$(ScreenshotSrc)\5-database-health.jpg" -vf scale=1280:-1 -q:v 4 "$(ScreenshotOut)\5-database-health.jpg"" Condition="'$(FfmpegExe)' != '' AND Exists('$(ScreenshotSrc)\5-database-health.jpg')" ContinueOnError="true" />
<Exec Command=""$(FfmpegExe)" -y -i "$(ScreenshotSrc)\6-instance-overview.jpg" -vf scale=1280:-1 -q:v 4 "$(ScreenshotOut)\6-instance-overview.jpg"" Condition="'$(FfmpegExe)' != '' AND Exists('$(ScreenshotSrc)\6-instance-overview.jpg')" ContinueOnError="true" />
<Exec Command=""$(FfmpegExe)" -y -i "$(ScreenshotSrc)\7-environment-map.jpg" -vf scale=1280:-1 -q:v 4 "$(ScreenshotOut)\7-environment-map.jpg"" Condition="'$(FfmpegExe)' != '' AND Exists('$(ScreenshotSrc)\7-environment-map.jpg')" ContinueOnError="true" />
<Exec Command=""$(FfmpegExe)" -y -i "$(ScreenshotSrc)\8-servers-easily-monitor-50-instances-or-more.jpg" -vf scale=1280:-1 -q:v 4 "$(ScreenshotOut)\8-servers-easily-monitor-50-instances-or-more.jpg"" Condition="'$(FfmpegExe)' != '' AND Exists('$(ScreenshotSrc)\8-servers-easily-monitor-50-instances-or-more.jpg')" ContinueOnError="true" />
<Exec Command=""$(FfmpegExe)" -y -i "$(ScreenshotSrc)\9-run-full-sql-audits.jpg" -vf scale=1280:-1 -q:v 4 "$(ScreenshotOut)\9-run-full-sql-audits.jpg"" Condition="'$(FfmpegExe)' != '' AND Exists('$(ScreenshotSrc)\9-run-full-sql-audits.jpg')" ContinueOnError="true" />
<Exec Command=""$(FfmpegExe)" -y -i "$(ScreenshotSrc)\10-microsoft-sql-vulnerability-assessment.jpg" -vf scale=1280:-1 -q:v 4 "$(ScreenshotOut)\10-microsoft-sql-vulnerability-assessment.jpg"" Condition="'$(FfmpegExe)' != '' AND Exists('$(ScreenshotSrc)\10-microsoft-sql-vulnerability-assessment.jpg')" ContinueOnError="true" />
<Exec Command=""$(FfmpegExe)" -y -i "$(ScreenshotSrc)\11-upload-results-securely-to-azure-blob-storage.jpg" -vf scale=1280:-1 -q:v 4 "$(ScreenshotOut)\11-upload-results-securely-to-azure-blob-storage.jpg"" Condition="'$(FfmpegExe)' != '' AND Exists('$(ScreenshotSrc)\11-upload-results-securely-to-azure-blob-storage.jpg')" ContinueOnError="true" />
<Exec Command=""$(FfmpegExe)" -y -i "$(ScreenshotSrc)\12-multiple-notification-channels.jpg" -vf scale=1280:-1 -q:v 4 "$(ScreenshotOut)\12-multiple-notification-channels.jpg"" Condition="'$(FfmpegExe)' != '' AND Exists('$(ScreenshotSrc)\12-multiple-notification-channels.jpg')" ContinueOnError="true" />
<Exec Command=""$(FfmpegExe)" -y -i "$(ScreenshotSrc)\13-maturity-roadmap.jpg" -vf scale=1280:-1 -q:v 4 "$(ScreenshotOut)\13-maturity-roadmap.jpg"" Condition="'$(FfmpegExe)' != '' AND Exists('$(ScreenshotSrc)\13-maturity-roadmap.jpg')" ContinueOnError="true" />
<Exec Command=""$(FfmpegExe)" -y -i "$(ScreenshotSrc)\14-alerting.jpg" -vf scale=1280:-1 -q:v 4 "$(ScreenshotOut)\14-alerting.jpg"" Condition="'$(FfmpegExe)' != '' AND Exists('$(ScreenshotSrc)\14-alerting.jpg')" ContinueOnError="true" />
<Exec Command=""$(FfmpegExe)" -y -i "$(ScreenshotSrc)\15-query-plan-viewer.jpg" -vf scale=1280:-1 -q:v 4 "$(ScreenshotOut)\15-query-plan-viewer.jpg"" Condition="'$(FfmpegExe)' != '' AND Exists('$(ScreenshotSrc)\15-query-plan-viewer.jpg')" ContinueOnError="true" />
<Exec Command=""$(FfmpegExe)" -y -i "$(ScreenshotSrc)\16-risk-register-compliance-mapping-ISO-SOC2-NIST.jpg" -vf scale=1280:-1 -q:v 4 "$(ScreenshotOut)\16-risk-register-compliance-mapping-ISO-SOC2-NIST.jpg"" Condition="'$(FfmpegExe)' != '' AND Exists('$(ScreenshotSrc)\16-risk-register-compliance-mapping-ISO-SOC2-NIST.jpg')" ContinueOnError="true" />
<Message Importance="high" Text="ffmpeg not found � skipping screenshot conversion" Condition="'$(FfmpegExe)' == ''" />
</Target>
<!-- Remove redundant publish folder and other unnecessary files -->
<Target Name="RemoveRedundantPublishFolder" AfterTargets="Build;Publish">
<RemoveDir Directories="$(OutputPath)publish;$(OutputPath)BenchmarkSuite1;$(OutputPath)Tests;$(OutputPath)PerformanceMonitor-main;$(PublishDir)publish" ContinueOnError="true" />
<Delete Files="$(OutputPath)*.pdb" Condition="'$(Configuration)' == 'Release'" ContinueOnError="true" />
</Target>
</Project>