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>
This commit is contained in:
Heikki Halmet
2019-09-18 15:09:52 +03:00
parent dd9a3883aa
commit e4ae752c0d

View File

@@ -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"