zpclean/build.ps1
Zhang Pu aaf36959d1 init: zpclean v1.0.0 首次发布
- 加固版留言系统 / 磁盘清理助手
- MIT License
2026-11-02 11:12:18 +08:00

22 lines
912 B
PowerShell
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ZPclean 构建脚本(Windows 上执行)
# 用法:右键 → 使用 PowerShell 运行;或在 PowerShell 里: .\build.ps1
$ErrorActionPreference = "Stop"
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
Set-Location $here
Write-Host "== 检查 dotnet SDK ==" -ForegroundColor Cyan
$ver = dotnet --version
Write-Host "SDK 版本: $ver"
Write-Host "== 还原依赖 ==" -ForegroundColor Cyan
dotnet restore
Write-Host "== 编译(Release)==" -ForegroundColor Cyan
dotnet build -c Release -warnaserror:false
Write-Host "== 发布单文件 exe ==" -ForegroundColor Cyan
dotnet publish -c Release -r win-x64 --self-contained false -p:PublishSingleFile=true -o ".\publish"
Write-Host ""
Write-Host "完成。产物在: $here\publish\ZPclean.exe" -ForegroundColor Green
Write-Host "(自包含版:把上面命令里的 --self-contained false 改成 true,exe 更大但不依赖装 .NET)"