| 1 | param( |
| 2 | [string]$Configuration = "Release", |
| 3 | [string]$Runtime = "win-x64", |
| 4 | [switch]$SkipCore |
| 5 | ) |
| 6 | |
| 7 | $ErrorActionPreference = "Stop" |
| 8 | $root = Split-Path -Parent $PSScriptRoot |
| 9 | $ui = Join-Path $root "ui\RblxTool" |
| 10 | $nativeTarget = Join-Path $ui "runtimes\$Runtime\native" |
| 11 | |
| 12 | if (-not $SkipCore) { |
| 13 | Push-Location $root |
| 14 | cargo build --release -p rblx-ffi |
| 15 | cargo build --release -p rblx-cli |
| 16 | Pop-Location |
| 17 | } |
| 18 | |
| 19 | New-Item -ItemType Directory -Force -Path $nativeTarget | Out-Null |
| 20 | Copy-Item (Join-Path $root "target\release\rblx_core.dll") $nativeTarget -Force |
| 21 | |
| 22 | Push-Location $ui |
| 23 | dotnet publish -c $Configuration -r $Runtime --self-contained true |
| 24 | Pop-Location |
| 25 | |
| 26 | Write-Host "published to $ui\bin\$Configuration\net8.0-windows10.0.19041.0\$Runtime\publish" |