Fix build and code structure improvements. New but essential UI functionality. CI improvements. Documentation improvements. AI module improvements.
This commit is contained in:
17
fix-xunit-refs.ps1
Normal file
17
fix-xunit-refs.ps1
Normal file
@@ -0,0 +1,17 @@
|
||||
$xunitPackages = @'
|
||||
<PackageReference Include="xunit" Version="2.9.3" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.2" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
|
||||
'@
|
||||
|
||||
Get-ChildItem -Path "src" -Filter "*.csproj" -Recurse | Where-Object { $_.Name -like "*.Tests.csproj" } | ForEach-Object {
|
||||
$content = Get-Content $_.FullName -Raw
|
||||
if ($content -match '<IsTestProject>true</IsTestProject>' -and $content -notmatch 'Include="xunit"') {
|
||||
# Find the first ItemGroup with PackageReference and add xunit there
|
||||
if ($content -match '(<ItemGroup>\s*<PackageReference)') {
|
||||
$content = $content -replace '(<ItemGroup>\s*<PackageReference)', "$xunitPackages`n`$1"
|
||||
Set-Content $_.FullName $content -NoNewline
|
||||
Write-Host "Added xunit to: $($_.FullName)"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user