forked from BynBang/OpenPrestige
18 lines
1.2 KiB
PowerShell
18 lines
1.2 KiB
PowerShell
# Build OpenPrestige and collect the host binaries in dist/.
|
|
param([string]$Python = 'python')
|
|
$ErrorActionPreference = 'Stop'
|
|
Set-Location $PSScriptRoot
|
|
if (Test-Path 'C:\Program Files\Eclipse Adoptium\jdk-21.0.12.101-hotspot') { $env:JAVA_HOME = 'C:\Program Files\Eclipse Adoptium\jdk-21.0.12.101-hotspot' }
|
|
& .\gradlew.bat bundlePayloads "-PpythonExecutable=$Python" --console=plain
|
|
if ($LASTEXITCODE -ne 0) { throw 'gradle bundlePayloads failed' }
|
|
$env:PRESTIGE_PAYLOAD = $null
|
|
$env:PRESTIGE_BUNDLE = Join-Path $PSScriptRoot 'build/bundle'
|
|
cargo build --release --manifest-path injector\Cargo.toml
|
|
if ($LASTEXITCODE -ne 0) { throw 'cargo build failed' }
|
|
New-Item -ItemType Directory -Force dist | Out-Null
|
|
Copy-Item injector\target\release\OpenPrestigeInjector.exe, injector\target\release\prestige_native.dll dist\ -Force
|
|
$version = (Get-Content gradle.properties | Where-Object { $_ -like 'mod_version=*' }) -replace '^mod_version=', ''
|
|
& $Python scripts/package_release.py offline dist $version windows-x86_64 dist/OpenPrestigeInjector.exe dist/prestige_native.dll build/bundle/common.jar
|
|
if ($LASTEXITCODE -ne 0) { throw 'release packaging failed' }
|
|
Write-Host 'Done: dist contains the offline multi-version Windows bundle'
|