summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeikki Halmet <heikki.halmet@qt.io>2017-01-10 09:59:14 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2017-02-03 05:47:05 +0000
commita36977963a9b6fad940f6ae8395401ce567f4b49 (patch)
tree5453dc6f2d841eb98e363be641f23b485622ee87
parent6afffd698574703acf2d4c8a30d07343a8a8e14f (diff)
Provision: Storage android sdk and ndk version information
Sdk and ndk version information will be storaged to versions.txt. Versions.txt will be used for all provision scripts and later on it's data will be printed to provision log. Also script name changed to match both android sdk and ndk. Change-Id: I3366e596f539099c3b587466d90905d0889398fe Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
-rw-r--r--coin/provisioning/qtci-linux-RHEL-6.6-x86_64/android_linux.sh (renamed from coin/provisioning/qtci-linux-RHEL-6.6-x86_64/android_sdk_linux.sh)48
1 files changed, 30 insertions, 18 deletions
diff --git a/coin/provisioning/qtci-linux-RHEL-6.6-x86_64/android_sdk_linux.sh b/coin/provisioning/qtci-linux-RHEL-6.6-x86_64/android_linux.sh
index 81132d9b..1d0630ce 100644
--- a/coin/provisioning/qtci-linux-RHEL-6.6-x86_64/android_sdk_linux.sh
+++ b/coin/provisioning/qtci-linux-RHEL-6.6-x86_64/android_linux.sh
@@ -48,23 +48,24 @@ targetFolder="/opt/android"
baseUrl="http://ci-files01-hki.ci.local/input/android"
# SDK
-sdkVersion="android-sdk_r24.4.1-linux.tgz"
+sdkPackage="android-sdk_r24.4.1-linux.tgz"
sdkBuildToolsVersion="23.0.3"
sdkApiLevel="android-18"
-sdkUrl="$baseUrl/$sdkVersion"
+sdkUrl="$baseUrl/$sdkPackage"
sdkSha1="725bb360f0f7d04eaccff5a2d57abdd49061326d"
-sdkTargetFile="$targetFolder/$sdkVersion"
+sdkTargetFile="$targetFolder/$sdkPackage"
sdkExtract="tar -C $targetFolder -zxf $sdkTargetFile"
sdkFolderName="android-sdk-linux"
sdkName="sdk"
# NDK
-ndkVersion="android-ndk-r10e-linux-x86_64.zip"
-ndkUrl="$baseUrl/$ndkVersion"
+ndkVersion="r10e"
+ndkPackage="android-ndk-$ndkVersion-linux-x86_64.zip"
+ndkUrl="$baseUrl/$ndkPackage"
ndkSha1="f692681b007071103277f6edc6f91cb5c5494a32"
-ndkTargetFile="$targetFolder/$ndkVersion"
+ndkTargetFile="$targetFolder/$ndkPackage"
ndkExtract="unzip $ndkTargetFile -d $targetFolder"
-ndkFolderName="android-ndk-r10e"
+ndkFolderName="android-ndk-$ndkVersion"
ndkName="ndk"
function InstallAndroidPackage {
@@ -77,29 +78,40 @@ function InstallAndroidPackage {
folderName=$7
name=$8
- sudo wget --tries=5 --waitretry=5 --output-document=$targetFile $url || echo "Failed to download '$url' multiple times"
+ sudo wget --tries=5 --waitretry=5 --output-document="$targetFile" "$url" || echo "Failed to download '$url' multiple times"
echo "$sha1 $targetFile" | sha1sum --check || echo "Failed to check sha1sum"
- sudo chmod 755 $targetFile
+ sudo chmod 755 "$targetFile"
sudo $extract || echo "Failed to extract $url"
- sudo chown -R qt:users $targetFolder/$folderName
- sudo mv $targetFolder/$folderName $targetFolder/$name || echo "Failed to rename $name"
- sudo rm -fr $targetFolder/$version
+ sudo chown -R qt:users "$targetFolder"/"$folderName"
+ sudo mv "$targetFolder"/"$folderName" "$targetFolder"/"$name" || echo "Failed to rename $name"
+ sudo rm -fr "$targetFolder"/"$version"
}
-sudo mkdir $targetFolder
+sudo mkdir "$targetFolder"
# Install Android SDK
-echo "Installing Android SDK version $sdkVersion..."
-InstallAndroidPackage $targetFolder $sdkVersion $sdkUrl $sdkSha1 $sdkTargetFile "$sdkExtract" $sdkFolderName $sdkName
+echo "Installing Android SDK version $sdkPackage..."
+InstallAndroidPackage "$targetFolder" $sdkPackage $sdkUrl $sdkSha1 $sdkTargetFile "$sdkExtract" $sdkFolderName $sdkName
# Install Android NDK
-echo "Installing Android NDK version $ndkVersion..."
-InstallAndroidPackage $targetFolder $ndkVersion $ndkUrl $ndkSha1 $ndkTargetFile "$ndkExtract" $ndkFolderName $ndkName
+echo "Installing Android NDK version $ndkPackage..."
+InstallAndroidPackage "$targetFolder" $ndkPackage $ndkUrl $ndkSha1 $ndkTargetFile "$ndkExtract" $ndkFolderName $ndkName
# run update for Android SDK and install SDK API version 18, latest SDK tools, platform-tools and build-tools
echo "Running Android SDK update for API version 18, SDK-tools, platform-tools and build-tools-$sdkBuildToolsVersion..."
-echo "y" |$targetFolder/sdk/tools/android update sdk --no-ui --all --filter $sdkApiLevel,tools,platform-tools,build-tools-$sdkBuildToolsVersion || echo "Failed to run update"
+echo "y" |"$targetFolder"/sdk/tools/android update sdk --no-ui --all --filter $sdkApiLevel,tools,platform-tools,build-tools-$sdkBuildToolsVersion || echo "Failed to run update"
# For Qt 5.6, we by default require API levels 10, 11, 16 and 18, but we can override this by setting ANDROID_API_VERSION=android-18
# From Qt 5.7 forward, if android-16 is not installed, Qt will automatically use more recent one.
echo 'export ANDROID_API_VERSION=android-18' >> ~/.bashrc
+# Storage version information to ~/versions.txt, which is used to print version information to provision log.
+echo "***** Android SDK *****" >> ~/versions.txt
+echo "Android SDK Api Level = $sdkApiLevel" >> ~/versions.txt
+echo "Android SDK Build Tools Version = $sdkBuildToolsVersion" >> ~/versions.txt
+platformTools="$(grep Pkg.Revision "$targetFolder"/sdk/platform-tools/source.properties | cut -c14-)"
+echo "Android Platform Tools = $platformTools" >> ~/versions.txt
+sdkTools="$(grep Pkg.Revision "$targetFolder"/sdk/tools/source.properties | cut -c14-)"
+echo "Android SDK Tools = $sdkTools" >> ~/versions.txt
+echo "***** Android NDK *****" >> ~/versions.txt
+echo "Android NDK Version = $ndkVersion" >> ~/versions.txt
+