From cb6709ce5c48a31ba1170c71494c1a3869ffa5bb Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Wed, 14 Feb 2018 07:46:11 +0100 Subject: Unify Windows provisioning scripts & improve error handling While Coin should also see exit codes != 0 as error, we should stick to one way of handling script errors. As Power Shell cmdlets signal an error by throwing an exception we should do the same (and that approach also works in Coin). Additionally extracting 7zip files was unified across scripts by using the existing helper function instead of reinventing the wheel again and again. A similar helper function was introduced for starting an external application (and handling its errors). Also echo and other "cmd" commands were replaced by their PowerShell equivalents to have a unified approach across our Windows provisioning scripts. Change-Id: I70129ce38692f1396c33c13b33a2918485fa5271 Reviewed-by: Frederik Gladhorn --- coin/provisioning/common/windows/android-openssl.ps1 | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 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 798b3e45..b0363c4c 100644 --- a/coin/provisioning/common/windows/android-openssl.ps1 +++ b/coin/provisioning/common/windows/android-openssl.ps1 @@ -47,23 +47,23 @@ $destination = "C:\Utils\openssl-android-master" Download https://www.openssl.org/source/openssl-$version.tar.gz \\ci-files01-hki.intra.qt.io\provisioning\openssl\openssl-$version.tar.gz $zip Verify-Checksum $zip $sha1 -C:\Utils\sevenzip\7z.exe x $zip -oC:\Utils -C:\Utils\sevenzip\7z.exe x C:\Utils\openssl-$version.tar -oC:\Utils +Extract-7Zip $zip C:\Utils +Extract-7Zip C:\Utils\openssl-$version.tar C:\Utils Rename-Item C:\Utils\openssl-$version $destination -Remove-Item $zip +Remove-Item -Path $zip Remove-Item C:\Utils\openssl-$version.tar -set CC=C:\utils\android-ndk-r10e\toolchains\arm-linux-androideabi-4.9\prebuilt\windows\bin\arm-linux-androideabi-gcc -set AR=C:\utils\android-ndk-r10e\toolchains\arm-linux-androideabi-4.9\prebuilt\windows\bin\arm-linux-androideabi-ar -set ANDROID_DEV=C:\utils\android-ndk-r10e\platforms\android-18\arch-arm\usr +Set-EnvironmentVariable "CC" "C:\utils\android-ndk-r10e\toolchains\arm-linux-androideabi-4.9\prebuilt\windows\bin\arm-linux-androideabi-gcc" +Set-EnvironmentVariable "AR" "C:\utils\android-ndk-r10e\toolchains\arm-linux-androideabi-4.9\prebuilt\windows\bin\arm-linux-androideabi-ar" +Set-EnvironmentVariable "ANDROID_DEV" "C:\utils\android-ndk-r10e\platforms\android-18\arch-arm\usr" # Make sure configure for openssl has a "make" and "perl" available $env:PATH = $env:PATH + ";C:\msys\1.0\bin;C:\strawberry\perl\bin" -echo "Configuring OpenSSL $version for Android..." -pushd $destination -C:\msys\1.0\bin\bash.exe -c "c:/strawberry/perl/bin/perl Configure shared android" -popd +Write-Host "Configuring OpenSSL $version for Android..." +Push-Location $destination +Run-Executable "C:\msys\1.0\bin\bash.exe" "-c `"c:/strawberry/perl/bin/perl Configure shared android`"" +Pop-Location # Following command is needed when using version 1.1.0. With version 1.1.0 msys is not needed. # C:\mingw530\bin\mingw32-make.exe include\openssl\opensslconf.h -- cgit v1.2.3