McuSupport: Improve version detector logic

McuPackageDirectoryVersionDetector class name was misleading,
McuPackageDirectoryEntriesVersionDetector better describes its
purpose as it can be used to search for a regex match among the
entries in packagePath filtered by filePattern. Also, remove
isFile boolean member variable since is not needed for current
use cases, ie Renesas Graphics library (RGL), and filePattern
can be used instead.

Also, improve version detector creation logic. If no filePattern
is present in the Json kit file, the regex match is based on
packagePath only, which is the correct way to detect the version
for RGL.

Task-number: UL-6642
Change-Id: I3ee2fdb623bdd77aea60f9eae3672b9b5aa40433
Reviewed-by: Rainer Keller <Rainer.Keller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Daniele Bortolotti
2022-10-19 14:24:16 +02:00
parent 9566124cad
commit 16261ad472
7 changed files with 14 additions and 24 deletions

View File

@@ -82,7 +82,7 @@ static McuPackageVersionDetector *generatePackageVersionDetector(const QString &
R"(\b(\d+\.\d+\.\d+)\b)");
if (envVar.startsWith("RGL"))
return new McuPackageDirectoryVersionDetector("rgl_*_obj_*", R"(\d+\.\d+\.\w+)", false);
return new McuPackagePathVersionDetector(R"(\d+\.\d+\.\w+)");
return nullptr;
}
@@ -613,7 +613,6 @@ VersionDetection parseVersionDetection(const QJsonObject &packageEntry)
versioning["executableArgs"].toString(),
versioning["xmlElement"].toString(),
versioning["xmlAttribute"].toString(),
versioning["isFile"].toBool(true),
};
}