Embed build output directly in console

This commit is contained in:
Steve Streeting 2021-02-18 16:03:05 +00:00
parent a1482265e8
commit b0e0d6baee

View File

@ -58,6 +58,8 @@ $result = 0
try { try {
if ($src -ne ".") { Push-Location $src } if ($src -ne ".") { Push-Location $src }
Write-Output "-- Build process starting --"
# Locate UE4 project file # Locate UE4 project file
$uprojfile = Get-ChildItem *.uproject | Select-Object -expand Name $uprojfile = Get-ChildItem *.uproject | Select-Object -expand Name
if (-not $uprojfile) { if (-not $uprojfile) {
@ -131,31 +133,10 @@ try {
} else { } else {
Write-Verbose "Running $buildbat $buildargs" Write-Verbose "Running $buildbat $buildargs"
$pinfo = New-Object System.Diagnostics.ProcessStartInfo $proc = Start-Process $buildbat $buildargs -Wait -PassThru -NoNewWindow
$pinfo.FileName = $buildbat if ($proc.ExitCode -ne 0) {
$pinfo.RedirectStandardError = $true $code = $proc.ExitCode
$pinfo.RedirectStandardOutput = $true
$pinfo.UseShellExecute = $false
$pinfo.Arguments = $buildargs
$process = New-Object System.Diagnostics.Process
$process.StartInfo = $pinfo
$process.Start() | Out-Null
Write-Host "UE4 Build: " -NoNewline
do {
Write-Host "." -NoNewline
start-sleep -Milliseconds 1000
} until ($process.HasExited)
Write-Host "."
if ($process.ExitCode -ne 0) {
$code = $process.ExitCode
Write-Output $process.StandardOutput.ReadToEnd()
Write-Output $process.StandardError.ReadToEnd()
throw "*** Build exited with code $code, see above" throw "*** Build exited with code $code, see above"
} else {
Write-Verbose $process.StandardOutput.ReadToEnd()
Write-Output "---- UE4 Build OK ----"
} }
} }