XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESystem

【Rust】XFE系统,基于Rust和汇编

公开
关注 0 Fork 0 Star 0
UTF-8
param([switch]$UpdateLock)
$ErrorActionPreference = 'Stop'
$taskRoot = [IO.Path]::GetFullPath((Join-Path $PSScriptRoot '../..'))
Push-Location $taskRoot
try {
    $patcherDirectory = Join-Path $taskRoot '.tools/CSharpBoot/Tools-3.0.94'
    $installed = & dotnet tool list --tool-path $patcherDirectory
    if ($LASTEXITCODE -ne 0) { throw 'Cannot inspect the project-local Cosmos patcher.' }
    if ($installed -match 'cosmos.patcher\s+3\.0\.94\s') {
        Write-Host 'Cosmos.Patcher 3.0.94 is already available in the project tool directory.'
    } elseif ($installed -match 'cosmos.patcher') {
        throw 'The project-local Cosmos patcher has an unexpected version.'
    } else {
        & dotnet tool install Cosmos.Patcher --version 3.0.94 --tool-path $patcherDirectory --configfile Tools/CSharpBoot/NuGet.Config
        if ($LASTEXITCODE -ne 0) { throw 'Project-local Cosmos patcher installation failed.' }
    }
    $restoreArguments = @('restore', 'Source/XFESystem.Kernel/XFESystem.Kernel.csproj', '--configfile', 'Tools/CSharpBoot/NuGet.Config')
    if ($UpdateLock) { $restoreArguments += '--force-evaluate' } else { $restoreArguments += '--locked-mode' }
    & dotnet @restoreArguments
    if ($LASTEXITCODE -ne 0) { throw 'Kernel dependency restore failed.' }
    & dotnet build Source/XFESystem.Kernel/XFESystem.Kernel.csproj --no-restore -c Release
    if ($LASTEXITCODE -ne 0) { throw 'NativeAOT kernel compilation or ELF linking failed.' }
} finally { Pop-Location }