[CmdletBinding()]
param([string]$OutputDirectory='')
$ErrorActionPreference='Stop'
$relogRoot=Split-Path -Parent $PSScriptRoot
$relogOutput=if($OutputDirectory){[IO.Path]::GetFullPath($OutputDirectory)}else{Join-Path $relogRoot 'artifacts/relog-20261023/native-build'}
$relogVersionMatch=[regex]::Match((Get-Content -LiteralPath (Join-Path $relogRoot 'native/ManagedPlugin/Platform.cs') -Raw),'const string PluginVersion = "([^"]+)";')
if(-not $relogVersionMatch.Success){throw 'Managed plugin version is missing.'}
$relogVersion=$relogVersionMatch.Groups[1].Value
New-Item -ItemType Directory -Force -Path $relogOutput | Out-Null
& (Join-Path $relogRoot 'scripts/Build-ManagedPlatform.ps1')
& (Join-Path $relogRoot 'scripts/Build-ManagedPlugin.ps1') -Flavor Standalone -OutputDirectory $relogOutput -SkipPlatform
Copy-Item -LiteralPath (Join-Path $relogOutput 'XFEEDNavigation.dll') -Destination (Join-Path $relogOutput 'XFEEDNavigation.Tests.dll') -Force
& (Join-Path $relogRoot 'scripts/Build-ManagedPlugin.ps1') -Flavor Loader -OutputDirectory $relogOutput -SkipPlatform
$relogLoader=Join-Path $relogOutput 'dinput8.dll'
[ordered]@{id='XFEEDToolBox.Plugin';version=$relogVersion;loader='dinput8.dll';sha256=(Get-FileHash -LiteralPath $relogLoader -Algorithm SHA256).Hash.ToLowerInvariant();supportedGameSha256='6891f70a021fa9f3a0e00458c284f48d1226e68ae7fc02ad48081aed47857e93';supportsTrade=$false;supportsRelog=$true;supportsNavigation=$true} | ConvertTo-Json | Set-Content -LiteralPath (Join-Path $relogOutput 'package.json') -Encoding utf8
Write-Output "Built an isolated NativeAOT plugin at $relogOutput; no game files were installed or changed."
[CmdletBinding()]
param([string]$OutputDirectory='')
$ErrorActionPreference='Stop'
$relogRoot=Split-Path -Parent $PSScriptRoot
$relogOutput=if($OutputDirectory){[IO.Path]::GetFullPath($OutputDirectory)}else{Join-Path $relogRoot 'artifacts/relog-20261023/native-build'}
$relogVersionMatch=[regex]::Match((Get-Content -LiteralPath (Join-Path $relogRoot 'native/ManagedPlugin/Platform.cs') -Raw),'const string PluginVersion = "([^"]+)";')
if(-not $relogVersionMatch.Success){throw 'Managed plugin version is missing.'}
$relogVersion=$relogVersionMatch.Groups[1].Value
New-Item -ItemType Directory -Force -Path $relogOutput | Out-Null
& (Join-Path $relogRoot 'scripts/Build-ManagedPlatform.ps1')
& (Join-Path $relogRoot 'scripts/Build-ManagedPlugin.ps1') -Flavor Standalone -OutputDirectory $relogOutput -SkipPlatform
Copy-Item -LiteralPath (Join-Path $relogOutput 'XFEEDNavigation.dll') -Destination (Join-Path $relogOutput 'XFEEDNavigation.Tests.dll') -Force
& (Join-Path $relogRoot 'scripts/Build-ManagedPlugin.ps1') -Flavor Loader -OutputDirectory $relogOutput -SkipPlatform
$relogLoader=Join-Path $relogOutput 'dinput8.dll'
[ordered]@{id='XFEEDToolBox.Plugin';version=$relogVersion;loader='dinput8.dll';sha256=(Get-FileHash -LiteralPath $relogLoader -Algorithm SHA256).Hash.ToLowerInvariant();supportedGameSha256='6891f70a021fa9f3a0e00458c284f48d1226e68ae7fc02ad48081aed47857e93';supportsTrade=$false;supportsRelog=$true;supportsNavigation=$true} | ConvertTo-Json | Set-Content -LiteralPath (Join-Path $relogOutput 'package.json') -Encoding utf8
Write-Output "Built an isolated NativeAOT plugin at $relogOutput; no game files were installed or changed."