#requires -Version 7.0
param([ValidateSet('Debug','Release')][string]$Configuration = 'Release')
$ErrorActionPreference = 'Stop'
$taskRoot = [IO.Path]::GetFullPath((Join-Path $PSScriptRoot '..'))
$taskBuildRoot = Join-Path $taskRoot ('artifacts/coverage-build/' + [Guid]::NewGuid().ToString('N'))
dotnet build (Join-Path $taskRoot 'Server/XFEWarframe.Server/XFEWarframe.Server.csproj') -c $Configuration ("-p:OutputPath=" + $taskBuildRoot + [IO.Path]::DirectorySeparatorChar) --nologo -v quiet
if ($LASTEXITCODE -ne 0) { throw 'Coverage build failed' }
$dll = Join-Path $taskBuildRoot 'XFEWarframe.Server.dll'
$json = dotnet $dll --routes
if ($LASTEXITCODE -ne 0) { throw 'Route enumeration failed' }
$routes = $json | ConvertFrom-Json
New-Item -ItemType Directory -Path (Join-Path $taskRoot 'docs') -Force | Out-Null
$json | Set-Content -LiteralPath (Join-Path $taskRoot 'docs/api-coverage.json') -Encoding utf8
$routes | Export-Csv -LiteralPath (Join-Path $taskRoot 'docs/api-coverage.csv') -NoTypeInformation -Encoding utf8
$routes | Group-Object Status | Select-Object Name,Count
#requires -Version 7.0
param([ValidateSet('Debug','Release')][string]$Configuration = 'Release')
$ErrorActionPreference = 'Stop'
$taskRoot = [IO.Path]::GetFullPath((Join-Path $PSScriptRoot '..'))
$taskBuildRoot = Join-Path $taskRoot ('artifacts/coverage-build/' + [Guid]::NewGuid().ToString('N'))
dotnet build (Join-Path $taskRoot 'Server/XFEWarframe.Server/XFEWarframe.Server.csproj') -c $Configuration ("-p:OutputPath=" + $taskBuildRoot + [IO.Path]::DirectorySeparatorChar) --nologo -v quiet
if ($LASTEXITCODE -ne 0) { throw 'Coverage build failed' }
$dll = Join-Path $taskBuildRoot 'XFEWarframe.Server.dll'
$json = dotnet $dll --routes
if ($LASTEXITCODE -ne 0) { throw 'Route enumeration failed' }
$routes = $json | ConvertFrom-Json
New-Item -ItemType Directory -Path (Join-Path $taskRoot 'docs') -Force | Out-Null
$json | Set-Content -LiteralPath (Join-Path $taskRoot 'docs/api-coverage.json') -Encoding utf8
$routes | Export-Csv -LiteralPath (Join-Path $taskRoot 'docs/api-coverage.csv') -NoTypeInformation -Encoding utf8
$routes | Group-Object Status | Select-Object Name,Count