fix(tools): improve build script discovery and update Verifier to System.CommandLine v8+

Build script:
- Add Get-RepoRelativePath() helper for cross-platform path handling
- Exclude node_modules and bin/obj from solution discovery

Verifier:
- Replace deprecated SetHandler with SetAction handler pattern
- Use GetRequiredValue/GetValue instead of GetValueForOption
- Replace SetDefaultValue with DefaultValueFactory property
- Remove CommandLineBuilder wrapper (built into framework now)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
master
2026-03-09 07:53:08 +02:00
parent e6094e3b53
commit e0c79e0dc0
4 changed files with 82 additions and 62 deletions

View File

@@ -31,8 +31,29 @@ $ErrorActionPreference = 'Continue'
$repoRoot = Split-Path -Parent $PSScriptRoot
$srcDir = Join-Path $repoRoot 'src'
function Get-RepoRelativePath {
param(
[Parameter(Mandatory = $true)]
[string]$Root,
[Parameter(Mandatory = $true)]
[string]$Path
)
$normalizedRoot = [System.IO.Path]::GetFullPath($Root).TrimEnd('\', '/')
$normalizedPath = [System.IO.Path]::GetFullPath($Path)
if ($normalizedPath.StartsWith($normalizedRoot, [System.StringComparison]::OrdinalIgnoreCase)) {
return $normalizedPath.Substring($normalizedRoot.Length).TrimStart('\', '/')
}
return $normalizedPath
}
$solutions = Get-ChildItem -Path $srcDir -Filter '*.sln' -Recurse |
Where-Object { $_.Name -ne 'StellaOps.sln' } |
Where-Object {
$_.Name -ne 'StellaOps.sln' -and
$_.FullName -notmatch '[\\/](node_modules|bin|obj)[\\/]'
} |
Sort-Object FullName
if ($solutions.Count -eq 0) {
@@ -50,7 +71,7 @@ $testFail = @()
$testSkipped = @()
foreach ($sln in $solutions) {
$rel = [System.IO.Path]::GetRelativePath($repoRoot, $sln.FullName)
$rel = Get-RepoRelativePath -Root $repoRoot -Path $sln.FullName
Write-Host "--- BUILD: $rel ---" -ForegroundColor Yellow
dotnet build $sln.FullName --configuration $Configuration --nologo -v quiet