Fix avdmanageroutputparser test

- There is no PLUGIN_DEPENDS for tests, and it wouldn't work anyhow
  because of duplicated symbols. It was interpreted as a dependency and
  the test disabled because no such target exists.
- Move the platformNameToApiLevel(...) function to
  avdmanageroutputparser.h to break the dependency to a lot of Android
  support code.

Amends 78da7e2922

Change-Id: I6933684a76e5291d415c72388caa3df2bee7cbfb
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Eike Ziller
2022-02-02 16:32:24 +01:00
committed by Alessandro Portale
parent 1e34d6ee22
commit 9bc9fb5a0d
6 changed files with 28 additions and 29 deletions

View File

@@ -473,28 +473,6 @@ QString AndroidConfig::apiLevelNameFor(const SdkPlatform *platform)
QString("android-%1").arg(platform->apiLevel()) : "";
}
int AndroidConfig::platformNameToApiLevel(const QString &platformName)
{
int apiLevel = -1;
static const QRegularExpression re("(android-)(?<apiLevel>[0-9A-Z]{1,})",
QRegularExpression::CaseInsensitiveOption);
QRegularExpressionMatch match = re.match(platformName);
if (match.hasMatch()) {
QString apiLevelStr = match.captured("apiLevel");
bool isUInt;
apiLevel = apiLevelStr.toUInt(&isUInt);
if (!isUInt) {
if (apiLevelStr == 'Q')
apiLevel = 29;
else if (apiLevelStr == 'R')
apiLevel = 30;
else if (apiLevelStr == 'S')
apiLevel = 31;
}
}
return apiLevel;
}
bool AndroidConfig::isCmdlineSdkToolsInstalled() const
{
QString toolPath("cmdline-tools/latest/bin/sdkmanager");