mirror of
https://github.com/logos-co/logos-cpp-sdk.git
synced 2026-08-30 17:21:15 +00:00
fix: read dependency entries declared in object form (#123)
* fix: read dependency entries declared in object form The manifest schema lets a dependency entry be an object carrying the name alongside the constraints an installer resolves it by, but every reader took the element as a plain string and skipped what came back empty, so an object entry disappeared: the module it names was left out of the generated LogosModules aggregate, and every call through it failed to compile. The rule lives in one place now, since the copies of it are how the gap spread. It ships in share/lidl-frontend alongside the parser that includes it, which consumers compile from there. * fix: read every dependency entry through one pass over the array The object form reached the umbrella's members and constructor but not its includes: that emitter still read each element as a plain string, so a module declared in object form came out as a member whose type was never included, and the aggregate no longer compiled. It is the Qt-free umbrella, which is what every universal core module and every cdylib module generates, so the form the previous commit set out to support failed there in a new way rather than working. Reading the array element by element is what let one pass disagree with the next, so no reader does that any more: dependencyNames() answers what an array declares, once, and the emitters walk names. That leaves the entry form knowable in exactly one place, and the includes and members of an aggregate can no longer be built from different answers. The umbrella emission moves to generator_lib alongside the per-module wrapper emitters it mirrors, returning the text instead of writing it, so what it generates can be asserted on directly; main.cpp writes what it returns. Output for string-form dependencies is byte-identical in both API styles, with and without interface dependencies. The listing mode (`--metadata` with no `--module-dir`) went the same way — it was the last reader still deciding on its own. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: Dario Gabriel Lipicar <dario@status.im> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
Dario Gabriel Lipicar
parent
d11fbb2220
commit
fde0f6fccb
@@ -1,5 +1,7 @@
|
||||
#include "impl_header_parser.h"
|
||||
|
||||
#include "metadata_dependencies.h"
|
||||
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QJsonDocument>
|
||||
@@ -392,9 +394,9 @@ ImplParseResult parseImplHeader(const QString& headerPath,
|
||||
result.module.version = obj.value("version").toString().toStdString();
|
||||
result.module.description = obj.value("description").toString().toStdString();
|
||||
result.module.category = obj.value("category").toString().toStdString();
|
||||
QJsonArray deps = obj.value("dependencies").toArray();
|
||||
for (const QJsonValue& v : deps)
|
||||
result.module.depends.push_back(v.toString().toStdString());
|
||||
const QJsonArray deps = obj.value("dependencies").toArray();
|
||||
for (const QString& depName : dependencyNames(deps))
|
||||
result.module.depends.push_back(depName.toStdString());
|
||||
|
||||
// Read events declared in metadata.json
|
||||
QJsonArray events = obj.value("events").toArray();
|
||||
|
||||
Reference in New Issue
Block a user