From 60d00afcfdaafe2ddba88cf341bc32b8457130f2 Mon Sep 17 00:00:00 2001 From: TMC Date: Thu, 12 Nov 2026 08:07:30 +0100 Subject: [PATCH] release.ps1: keep Gradle's warnings from stopping a piped run Gradle prints compiler warnings on its error stream. When the script's output was piped or sent to a file, PowerShell 5.1 took the first such line for an error and stopped the build at step 2 (seen on the first 0.3.1 attempt). The streams are now merged inside cmd, and only the exit code decides whether the build failed. Co-Authored-By: Claude Fable 5.2 --- flexera/release.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flexera/release.ps1 b/flexera/release.ps1 index 9c4e185900..d0eaf780b0 100644 --- a/flexera/release.ps1 +++ b/flexera/release.ps1 @@ -170,7 +170,10 @@ if ($SkipBuild) { Get-ChildItem (Join-Path $Root 'build\kotlin') -Directory -Filter "compile${Variant}Kotlin*" -ErrorAction SilentlyContinue | Remove-Item -Recurse -Force $env:JAVA_HOME = $JavaHome - cmd /c ".\gradlew.bat assemble$Variant --no-build-cache --console=plain" + # "2>&1" inside cmd: Gradle prints compiler warnings on its error stream. If this script's + # output is piped or sent to a file, PowerShell would otherwise take the first such line + # for an error and stop the build. Only the exit code says whether the build failed. + cmd /c ".\gradlew.bat assemble$Variant --no-build-cache --console=plain 2>&1" if ($LASTEXITCODE -ne 0) { throw "The build failed." } } if (-not (Test-Path $apk)) { throw "Expected the APK at $apk, but it is not there." }