diff options
author | Heikki Halmet <heikki.halmet@qt.io> | 2019-09-18 15:09:52 +0300 |
---|---|---|
committer | Heikki Halmet <heikki.halmet@qt.io> | 2019-10-09 11:50:32 +0300 |
commit | e4ae752c0d460cb9a8b3166664319f706f1a1b1a (patch) | |
tree | 81bfff7f926ace83b88f217daf19ff5fef174d8f /coin | |
parent | dd9a3883aa93277c429b83dcaad20a2a9aeb7fab (diff) |
Provisioning: Make sure that Configure and Make will pass
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 <tony.sarajarvi@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'coin')
-rw-r--r-- | coin/provisioning/common/windows/android-openssl.ps1 | 23 |
1 files changed, 20 insertions, 3 deletions
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" |