summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeikki Halmet <heikki.halmet@qt.io>2017-01-25 10:12:36 +0200
committerLiang Qi <liang.qi@qt.io>2017-01-28 03:57:41 +0000
commitd4681ee6906f441d072df6e060599e6d7741d5a4 (patch)
tree767585175609ca1a41d7ff8e3a53f3e271d7be25
parent3276f075b9649489d0d61fe624e3e8efac6e30ea (diff)
Android sdk and ndk to provisioning for Windows 7
Installs latest Android sdk and ndk. It also runs update for SDK API level 18, latest SDK- and platform- tools and build-tools version 23.0.3. Task-number: QTBUG-58369 Change-Id: Ib42f5149243fc5d262f6542e26726d1c8cbb2e8c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r--coin/provisioning/common/01-windows_removethemall.ps15
-rw-r--r--coin/provisioning/common/memorypershell.ps13
-rw-r--r--coin/provisioning/qtci-windows-7-x86/02-memorypershell.ps11
-rw-r--r--coin/provisioning/qtci-windows-7-x86/06-android.ps165
-rw-r--r--coin/provisioning/qtci-windows-7-x86/07-android_openssl.ps1 (renamed from coin/provisioning/qtci-windows-7-x86/android_openssl.ps1)0
5 files changed, 74 insertions, 0 deletions
diff --git a/coin/provisioning/common/01-windows_removethemall.ps1 b/coin/provisioning/common/01-windows_removethemall.ps1
index 8285ddae..9e64a34d 100644
--- a/coin/provisioning/common/01-windows_removethemall.ps1
+++ b/coin/provisioning/common/01-windows_removethemall.ps1
@@ -59,3 +59,8 @@ Function Remove-Path {
Remove C:\Python27
Remove-Path C:\python27\scripts
Remove-Path C:\python27
+
+# Remove Android sdk and ndk
+Remove C:\utils\android*
+[Environment]::SetEnvironmentVariable("ANDROID_NDK_HOME",$null,"User")
+[Environment]::SetEnvironmentVariable("ANDROID_SDK_HOME",$null,"User")
diff --git a/coin/provisioning/common/memorypershell.ps1 b/coin/provisioning/common/memorypershell.ps1
new file mode 100644
index 00000000..2a8ebb68
--- /dev/null
+++ b/coin/provisioning/common/memorypershell.ps1
@@ -0,0 +1,3 @@
+# This is needed e.g. for Android NDK installation for Windows 7 x86
+echo "Increase value of MaxMemoryPerShellMB to avoid 'out of memory' exception"
+set-item wsman:localhost\Shell\MaxMemoryPerShellMB 2048
diff --git a/coin/provisioning/qtci-windows-7-x86/02-memorypershell.ps1 b/coin/provisioning/qtci-windows-7-x86/02-memorypershell.ps1
new file mode 100644
index 00000000..ba24f9d7
--- /dev/null
+++ b/coin/provisioning/qtci-windows-7-x86/02-memorypershell.ps1
@@ -0,0 +1 @@
+. "$PSScriptRoot\..\common\memorypershell.ps1"
diff --git a/coin/provisioning/qtci-windows-7-x86/06-android.ps1 b/coin/provisioning/qtci-windows-7-x86/06-android.ps1
new file mode 100644
index 00000000..96be39a3
--- /dev/null
+++ b/coin/provisioning/qtci-windows-7-x86/06-android.ps1
@@ -0,0 +1,65 @@
+. "$PSScriptRoot\..\common\helpers.ps1"
+
+# This script installs Android sdk and ndk
+# It also runs update for SDK API level 18, latest SDK tools, latest platform-tools and build-tools version $sdkBuildToolsVersion
+# Android 16 is the minimum requirement for Qt 5.7 applications, but we need something more recent than that for building Qt itself.
+# E.g the bluetooth features that require Android 18 will disable themselves dynamically when running on Android 16 device.
+# That's why we need to use Andoid-18 API version and decision was made to use it also with Qt 5.6.
+
+# NDK
+$ndkVersion = "r10e"
+$ndkCachedUrl = "http://ci-files01-hki.ci.local/input/android/android-ndk-$ndkVersion-windows-x86.zip"
+$ndkOfficialUrl = "https://dl.google.com/android/repository/android-ndk-$ndkVersion-windows-x86.zip"
+$ndkChecksum = "1d0b8f2835be741f3048fb03c0a3e9f71ab7f357"
+$ndkFolder = "c:\utils\android-ndk-$ndkVersion"
+$ndkZip = "c:\Windows\Temp\android_ndk_$ndkVersion.zip"
+
+# SDK
+$sdkVersion = "r24.4.1"
+$sdkApi = "ANDROID_API_VERSION"
+$sdkApiLevel = "android-18"
+$sdkBuildToolsVersion = "23.0.3"
+$sdkCachedUrl= "http://ci-files01-hki.ci.local/input/android/android-sdk_$sdkVersion-windows.zip"
+$sdkOfficialUrl = "https://dl.google.com/android/android-sdk_$sdkVersion-windows.zip"
+$sdkChecksum = "66b6a6433053c152b22bf8cab19c0f3fef4eba49"
+$sdkFolder = "c:\utils\android-sdk-windows"
+$sdkZip = "c:\Windows\Temp\android_sdk_$sdkVersion.zip"
+
+function Install($1, $2, $3, $4) {
+ $cacheUrl = $1
+ $zip = $2
+ $checksum = $3
+ $offcialUrl = $4
+
+ Download $offcialUrl $cacheUrl $zip
+ Verify-Checksum $zip "$checksum"
+ Extract-Zip $zip C:\Utils
+}
+
+function SdkUpdate ($1, $2) {
+ echo "Running Android SDK update for $1..."
+ cmd /c "echo y |$1\tools\android update sdk --no-ui --all --filter $2"
+}
+
+echo "Installing Android ndk $nkdVersion"
+Install $ndkCachedUrl $ndkZip $ndkChecksum $ndkOfficialUrl
+echo "Set environment variable ANDROID_NDK_HOME=$ndkFolder"
+[Environment]::SetEnvironmentVariable("ANDROID_NDK_HOME", $ndkFolder, "Machine")
+echo "Set environment variable ANDROID_NDK_ROOT=$ndkFolder"
+[Environment]::SetEnvironmentVariable("ANDROID_NDK_ROOT", $ndkFolder, "Machine")
+
+#echo "Installing Android sdk $sdkVersion"
+Install $sdkCachedUrl $sdkZip $sdkChecksum $sdkOfficialUrl
+echo "Set environment variable ANDROID_SDK_HOME=$sdkFolder"
+[Environment]::SetEnvironmentVariable("ANDROID_SDK_HOME", $sdkFolder, "Machine")
+echo "Set environment variable ANDROID_API_VERSION $sdkApiLevel"
+[Environment]::SetEnvironmentVariable("ANDROID_API_VERSION", $sdkApiLevel, "Machine")
+
+# SDK update
+SdkUpdate $sdkFolder $sdkApiLevel
+SdkUpdate $sdkFolder tools
+SdkUpdate $sdkFolder platform-tools
+SdkUpdate $sdkFolder build-tools-$sdkBuildToolsVersion
+
+# kill adb. This process prevent's provisioning to continue
+taskkill /im adb.exe /f
diff --git a/coin/provisioning/qtci-windows-7-x86/android_openssl.ps1 b/coin/provisioning/qtci-windows-7-x86/07-android_openssl.ps1
index a1b656c6..a1b656c6 100644
--- a/coin/provisioning/qtci-windows-7-x86/android_openssl.ps1
+++ b/coin/provisioning/qtci-windows-7-x86/07-android_openssl.ps1