Android: keep up with sdk tools changing folder structure

The cmdline-tools package used to have the folder structure "tools/bin".
However, latest packages are using the structure "cmdline-tools/bin".
And since subsequent updates we are installing "cmdline-tools;latest"
package, it will be put in "cmdline-tools/latest" folder, so we cannot
extract to that path, or otherwise sdkmanager will complain that the
path is in use.

Currently we extract it and put it under the SDK path, then use it to
install the essential packages, then it won't be used at all. This patch
changes that by extracting the downloaded package into a temporary
location, and use sdkmanager from there directly.

Also, this patch updates the links to the cmdline-tools along the way.

Fixes: QTCREATORBUG-27174
Change-Id: I1f5d0e38f5a026631e8a3852821d85a69d543c32
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Assam Boudjelthia
2020-11-28 15:44:37 +02:00
parent 188544052c
commit 5454dda249
9 changed files with 116 additions and 56 deletions

View File

@@ -102,5 +102,8 @@ const Utils::Id AndroidCpuAbi = "AndroidCpuAbi";
const Utils::Id AndroidSdk = "AndroidSdk";
const Utils::Id AndroidAvdPath = "AndroidAvdPath";
// SDK Tools
const char cmdlineToolsName[] = "cmdline-tools";
} // namespace Constants;
} // namespace Android