From e4ae752c0d460cb9a8b3166664319f706f1a1b1a Mon Sep 17 00:00:00 2001 From: Heikki Halmet Date: Wed, 18 Sep 2019 15:09:52 +0300 Subject: Provisioning: Make sure that Configure and Make will pass MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit During powershell process error is not caught and provisioning continues even if the exitcode is something else that '0' Task-number: QTQAINFRA-3214 Change-Id: I91116a78d0c4defe6ba4287913c2394e199be958 Reviewed-by: Tony Sarajärvi Reviewed-by: Mårten Nordheim --- .../common/windows/android-openssl.ps1 | 23 +++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'coin/provisioning/common/windows/android-openssl.ps1') diff --git a/coin/provisioning/common/windows/android-openssl.ps1 b/coin/provisioning/common/windows/android-openssl.ps1 index 981fa51d..c3c3156a 100644 --- a/coin/provisioning/common/windows/android-openssl.ps1 +++ b/coin/provisioning/common/windows/android-openssl.ps1 @@ -1,6 +1,6 @@ ############################################################################ ## -## Copyright (C) 2018 The Qt Company Ltd. +## Copyright (C) 2019 The Qt Company Ltd. ## Contact: http://www.qt.io/licensing/ ## ## This file is part of the provisioning scripts of the Qt Toolkit. @@ -65,8 +65,25 @@ Remove-Item -Path $zip Write-Host "Configuring OpenSSL $version for Android..." Push-Location $destination # $ must be escaped in powershell... -Start-Process -NoNewWindow -Wait -ErrorAction Stop -FilePath "$msys_bash" -ArgumentList ("-lc", "`"pushd $openssl_path; ANDROID_NDK_HOME=$ndkPath PATH=${cc_path}:`$PATH CC=clang $openssl_path/Configure shared android-arm`"") -Start-Process -NoNewWindow -Wait -ErrorAction Stop -FilePath "$msys_bash" -ArgumentList ("-lc", "`"pushd $openssl_path; ANDROID_NDK_HOME=$ndkPath PATH=${cc_path}:`$PATH CC=clang make -f $openssl_path/Makefile build_generated`"") + +function CheckExitCode { + + param ( + $p + ) + + if ($p.ExitCode) { + Write-host "Process failed with exit code: $($p.ExitCode)" + exit 1 + } +} + +$configure = Start-Process -NoNewWindow -Wait -PassThru -ErrorAction Stop -FilePath "$msys_bash" -ArgumentList ("-lc", "`"pushd $openssl_path; ANDROID_NDK_HOME=$ndkPath PATH=${cc_path}:`$PATH CC=clang $openssl_path/Configure shared android-arm`"") +CheckExitCode $configure + +$make = Start-Process -NoNewWindow -Wait -PassThru -ErrorAction Stop -FilePath "$msys_bash" -ArgumentList ("-lc", "`"pushd $openssl_path; ANDROID_NDK_HOME=$ndkPath PATH=${cc_path}:`$PATH CC=clang make -f $openssl_path/Makefile build_generated`"") +CheckExitCode $make + Pop-Location Set-EnvironmentVariable "OPENSSL_ANDROID_HOME" "$destination" -- cgit v1.2.3