Build.ps1 831 B

1234567891011121314
  1. param(
  2. [string]$DotnetPath = 'dotnet',
  3. [string]$OutputDirectory = ''
  4. )
  5. $ErrorActionPreference = 'Stop'
  6. $repo = Split-Path -Parent $PSScriptRoot
  7. if (-not $OutputDirectory) { $OutputDirectory = Join-Path $repo 'artifacts\PCL-Communist-2.99.0.0' }
  8. $project = Join-Path $repo 'Plain Craft Launcher 2\Plain Craft Launcher 2.vbproj'
  9. & $DotnetPath build $project -c Release -v:minimal -p:IncludePrivateBuildCredentials=false
  10. if ($LASTEXITCODE -ne 0) { throw 'Launcher build failed.' }
  11. New-Item -ItemType Directory -Path $OutputDirectory -Force | Out-Null
  12. $binary = Join-Path $repo 'Plain Craft Launcher 2\bin\Plain Craft Launcher 2.exe'
  13. Copy-Item -LiteralPath $binary -Destination (Join-Path $OutputDirectory 'PCL Communist.exe') -Force
  14. Get-FileHash -LiteralPath (Join-Path $OutputDirectory 'PCL Communist.exe') -Algorithm SHA256