fixes save
This commit is contained in:
37
devops/scripts/fix-xunit-v3-conflict.ps1
Normal file
37
devops/scripts/fix-xunit-v3-conflict.ps1
Normal file
@@ -0,0 +1,37 @@
|
||||
# Fix xunit.v3 projects that conflict with Directory.Build.props xunit 2.x
|
||||
# Add UseConcelierTestInfra=false to exclude them from common test infrastructure
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$srcPath = Join-Path $PSScriptRoot "..\..\src"
|
||||
|
||||
# Find all csproj files that reference xunit.v3
|
||||
$xunitV3Projects = Get-ChildItem -Path $srcPath -Recurse -Filter "*.csproj" |
|
||||
Where-Object { (Get-Content $_.FullName -Raw) -match "xunit\.v3" }
|
||||
|
||||
Write-Host "Found $($xunitV3Projects.Count) projects with xunit.v3" -ForegroundColor Cyan
|
||||
|
||||
$fixedCount = 0
|
||||
|
||||
foreach ($proj in $xunitV3Projects) {
|
||||
$content = Get-Content $proj.FullName -Raw
|
||||
|
||||
# Check if already has UseConcelierTestInfra set
|
||||
if ($content -match "<UseConcelierTestInfra>") {
|
||||
Write-Host " Skipped (already configured): $($proj.Name)" -ForegroundColor DarkGray
|
||||
continue
|
||||
}
|
||||
|
||||
# Add UseConcelierTestInfra=false after the first <PropertyGroup>
|
||||
$newContent = $content -replace "(<PropertyGroup>)", "`$1`n <UseConcelierTestInfra>false</UseConcelierTestInfra>"
|
||||
|
||||
# Only write if changed
|
||||
if ($newContent -ne $content) {
|
||||
Set-Content -Path $proj.FullName -Value $newContent -NoNewline
|
||||
Write-Host " Fixed: $($proj.Name)" -ForegroundColor Green
|
||||
$fixedCount++
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "Fixed $fixedCount projects" -ForegroundColor Cyan
|
||||
Reference in New Issue
Block a user