Files
netch/build.ps1
2021-09-14 09:42:00 +08:00

47 lines
820 B
PowerShell

param (
[Parameter()]
[ValidateSet('Debug', 'Release')]
[string]
$Configuration = 'Release',
[Parameter()]
[ValidateNotNullOrEmpty()]
[string]
$OutputPath = 'release',
[Parameter()]
[bool]
$SelfContained = $False,
[Parameter()]
[bool]
$PublishReadyToRun = $False,
[Parameter()]
[bool]
$PublishSingleFile = $True
)
Remove-Item -Recurse -Force $OutputPath
.\scripts\download.ps1 $OutputPath
# if ( -Not $? ) {
# Exit 1
# }
Write-Host "Building $Configuration to $OutputPath"
dotnet publish `
-c $Configuration `
-r "win-x64" `
-p:Platform="x64" `
-p:PublishSingleFile=$PublishSingleFile `
-p:SelfContained=$SelfContained `
-p:PublishTrimmed=$SelfContained `
-p:PublishReadyToRun=$PublishReadyToRun `
-o $OutputPath `
Netch\Netch.csproj
if ($lastExitCode) { exit $lastExitCode }
exit 0