forked from qt-creator/qt-creator
Android: Fix version mapping from sdk_definitions.json
- Support multi-digit values for version ranges, via "+" in the RegExp - Turn the RegExp expression into a raw string for easier reading - Fix shortVersion (Maj.Min.-1) handling by appending the ".-1" - Explicitly define the Patch number range for 5.15 in sdk_definitions Change-Id: Icf22f2b4f865b4d5bcff48569aa58137294129ce Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
"ndk_path": "ndk/23.1.7779620"
|
"ndk_path": "ndk/23.1.7779620"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"versions": ["6.3", "6.2", "5.15"],
|
"versions": ["6.3", "6.2", "5.15.[9-20]"],
|
||||||
"sdk_essential_packages": ["build-tools;31.0.0", "ndk;22.1.7171670"],
|
"sdk_essential_packages": ["build-tools;31.0.0", "ndk;22.1.7171670"],
|
||||||
"ndk_path": "ndk/22.1.7171670"
|
"ndk_path": "ndk/22.1.7171670"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -344,13 +344,13 @@ void AndroidConfig::parseDependenciesJson()
|
|||||||
|
|
||||||
auto fillQtVersionsRange = [](const QString &shortVersion) {
|
auto fillQtVersionsRange = [](const QString &shortVersion) {
|
||||||
QList<QtVersionNumber> versions;
|
QList<QtVersionNumber> versions;
|
||||||
QRegularExpression re("([0-9]\\.[0-9]*\\.)\\[([0-9])\\-([0-9])\\]");
|
const QRegularExpression re(R"(([0-9]\.[0-9]+\.)\[([0-9]+)\-([0-9]+)\])");
|
||||||
QRegularExpressionMatch match = re.match(shortVersion);
|
QRegularExpressionMatch match = re.match(shortVersion);
|
||||||
if (match.hasMatch() && match.lastCapturedIndex() == 3)
|
if (match.hasMatch() && match.lastCapturedIndex() == 3)
|
||||||
for (int i = match.captured(2).toInt(); i <= match.captured(3).toInt(); ++i)
|
for (int i = match.captured(2).toInt(); i <= match.captured(3).toInt(); ++i)
|
||||||
versions.append(QtVersionNumber(match.captured(1) + QString::number(i)));
|
versions.append(QtVersionNumber(match.captured(1) + QString::number(i)));
|
||||||
else
|
else
|
||||||
versions.append(QtVersionNumber(shortVersion));
|
versions.append(QtVersionNumber(shortVersion + ".-1"));
|
||||||
|
|
||||||
return versions;
|
return versions;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user