Update build.ps1

pull/6190/head
2dust 2024-11-27 14:22:42 +08:00
parent 28447a9d43
commit a55c65374d
1 changed files with 14 additions and 14 deletions

View File

@ -2,57 +2,57 @@ param (
[Parameter()] [Parameter()]
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[string] [string]
$OutputPath = '.\bin\v2rayN' $OutputPath = './bin/v2rayN'
) )
Write-Host 'Building' Write-Host 'Building'
dotnet publish ` dotnet publish `
.\v2rayN\v2rayN.csproj ` ./v2rayN/v2rayN.csproj `
-c Release ` -c Release `
-r win-x64 ` -r win-x64 `
--self-contained false ` --self-contained false `
-p:PublishReadyToRun=false ` -p:PublishReadyToRun=false `
-p:PublishSingleFile=true ` -p:PublishSingleFile=true `
-o "$OutputPath\win-x64" -o "$OutputPath/win-x64"
dotnet publish ` dotnet publish `
.\v2rayN\v2rayN.csproj ` ./v2rayN/v2rayN.csproj `
-c Release ` -c Release `
-r win-arm64 ` -r win-arm64 `
--self-contained false ` --self-contained false `
-p:PublishReadyToRun=false ` -p:PublishReadyToRun=false `
-p:PublishSingleFile=true ` -p:PublishSingleFile=true `
-o "$OutputPath\win-arm64" -o "$OutputPath/win-arm64"
dotnet publish ` dotnet publish `
.\v2rayN.Desktop\v2rayN.Desktop.csproj ` ./v2rayN.Desktop/v2rayN.Desktop.csproj `
-c Release ` -c Release `
-r linux-x64 ` -r linux-x64 `
--self-contained true ` --self-contained true `
-p:PublishReadyToRun=false ` -p:PublishReadyToRun=false `
-p:PublishSingleFile=true ` -p:PublishSingleFile=true `
-o "$OutputPath\linux-x64" -o "$OutputPath/linux-x64"
dotnet publish ` dotnet publish `
.\v2rayN.Desktop\v2rayN.Desktop.csproj ` ./v2rayN.Desktop/v2rayN.Desktop.csproj `
-c Release ` -c Release `
-r linux-arm64 ` -r linux-arm64 `
--self-contained true ` --self-contained true `
-p:PublishReadyToRun=false ` -p:PublishReadyToRun=false `
-p:PublishSingleFile=true ` -p:PublishSingleFile=true `
-o "$OutputPath\linux-arm64" -o "$OutputPath/linux-arm64"
if ( -Not $? ) { if ( -Not $? ) {
exit $lastExitCode exit $lastExitCode
} }
if ( Test-Path -Path .\bin\v2rayN ) { if ( Test-Path -Path ./bin/v2rayN ) {
rm -Force "$OutputPath\win-x64\*.pdb" rm -Force "$OutputPath/win-x64/*.pdb"
rm -Force "$OutputPath\win-arm64\*.pdb" rm -Force "$OutputPath/win-arm64/*.pdb"
rm -Force "$OutputPath\linux-x64\*.pdb" rm -Force "$OutputPath/linux-x64/*.pdb"
rm -Force "$OutputPath\linux-arm64\*.pdb" rm -Force "$OutputPath/linux-arm64/*.pdb"
} }
Write-Host 'Build done' Write-Host 'Build done'