29 lines
925 B
PowerShell
29 lines
925 B
PowerShell
# 年糕工具 Build Script
|
|
# Usage: .\build.ps1
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
$buildDir = "build\bin"
|
|
|
|
Write-Host ""
|
|
Write-Host "=== 年糕工具 Build ===" -ForegroundColor Cyan
|
|
Write-Host ""
|
|
|
|
# Build with nofitz (go-fitz excluded, DLL embedded)
|
|
Write-Host "Building..." -ForegroundColor Yellow
|
|
wails build -tags nofitz
|
|
if ($LASTEXITCODE -ne 0) { Write-Host "Build failed!" -ForegroundColor Red; exit 1 }
|
|
|
|
# Rename using cmd to avoid encoding issues
|
|
cmd /c "copy /Y `"$buildDir\xk.exe`" `"$buildDir\年糕工具.exe`""
|
|
cmd /c "del /f /q `"$buildDir\xk.exe`""
|
|
cmd /c "del /f /q `"$buildDir\xk-dev.exe`""
|
|
|
|
# Remove standalone DLL (it's embedded now)
|
|
cmd /c "del /f /q `"$buildDir\libmupdf.dll`""
|
|
cmd /c "del /f /q `"$buildDir\MuPDFLib.dll`""
|
|
|
|
Write-Host ""
|
|
Write-Host "=== Build Complete ===" -ForegroundColor Green
|
|
Write-Host " $buildDir\年糕工具.exe (single file, DLL embedded)" -ForegroundColor Gray
|
|
Write-Host ""
|