Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[projmgr] Fix classic generator's bootstrap content reporting #1870

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 34 additions & 20 deletions tools/projmgr/src/ProjMgrWorker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2237,27 +2237,33 @@ bool ProjMgrWorker::ProcessComponentFiles(ContextItem& context) {
}
}
}
// all filtered files from packs except bootstrap and config files
const bool bootstrap = rteComponent->GetGenerator() && !rteComponent->IsGenerated();
if (!bootstrap) {
const set<RteFile*>& filteredfilesSet = context.rteActiveTarget->GetFilteredFiles(rteComponent);
auto cmp = [](RteFile* a, RteFile* b) { return a->GetName() < b->GetName(); };
set<RteFile*, decltype(cmp)> filteredfiles(cmp);
filteredfiles.insert(filteredfilesSet.begin(), filteredfilesSet.end());
for (const auto& componentFile : filteredfiles) {
const auto& attr = componentFile->GetAttribute("attr");
if (attr == "config") {
continue;
}
const auto& category = componentFile->GetAttribute("category");
const auto& name = category == "doc" ? componentFile->GetDocFile() :
rteComponent->GetPackage()->GetAbsolutePackagePath() + componentFile->GetAttribute("name");
const auto& scope = componentFile->GetAttribute("scope");
const auto& language = componentFile->GetAttribute("language");
const auto& select = componentFile->GetAttribute("select");
const auto& version = componentFile->GetVersionString();
context.componentFiles[componentId].push_back({ name, attr, category, language, scope, version, select });
// all filtered files from packs except gen and config files
const set<RteFile*>& filteredfilesSet = context.rteActiveTarget->GetFilteredFiles(rteComponent);
auto cmp = [](RteFile* a, RteFile* b) { return a->GetName() < b->GetName(); };
set<RteFile*, decltype(cmp)> filteredfiles(cmp);
filteredfiles.insert(filteredfilesSet.begin(), filteredfilesSet.end());
for (const auto& componentFile : filteredfiles) {
const auto& attr = componentFile->GetAttribute("attr");
if (attr == "config") {
continue;
}
const auto& category = componentFile->GetAttribute("category");
const auto& name = category == "doc" ? componentFile->GetDocFile() :
rteComponent->GetPackage()->GetAbsolutePackagePath() + componentFile->GetAttribute("name");
const auto& scope = componentFile->GetAttribute("scope");
const auto& language = componentFile->GetAttribute("language");
const auto& select = componentFile->GetAttribute("select");
const auto& version = componentFile->GetVersionString();
switch (RteFile::CategoryFromString(category)) {
case RteFile::Category::GEN_SOURCE:
case RteFile::Category::GEN_HEADER:
case RteFile::Category::GEN_PARAMS:
case RteFile::Category::GEN_ASSET:
continue; // ignore gen files
default:
break;
};
context.componentFiles[componentId].push_back({ name, attr, category, language, scope, version, select });
}
// config files
map<const RteItem*, string> configFilePaths;
Expand Down Expand Up @@ -2552,6 +2558,14 @@ bool ProjMgrWorker::ProcessGpdsc(ContextItem& context) {
components = gpdscComponent->GetChildren();
}
for (const auto component : components) {
if (bootstrap.instance->GetComponentID(false) == component->GetComponentID(false)) {
if (VersionCmp::Compare(bootstrap.instance->GetVersionString(), component->GetVersionString()) > 0) {
// bootstrap has greater version, do not replace it
continue;
} else {
context.components.erase(bootstrap.instance->GetComponentID(true));
}
}
const auto& componentId = component->GetComponentID(true);
RteComponentInstance* componentInstance = new RteComponentInstance(component);
componentInstance->InitInstance(component);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ build:
condition: RteDevice
from-pack: ARM::[email protected]
selected-by: Device:RteTest Generated Component:RteTest
files:
- file: ${CMSIS_PACK_ROOT}/ARM/RteTestGenerator/0.1.0/Templates/RteTest.gpdsc.template
category: other
version: 1.0.0
generator:
id: RteTestGeneratorIdentifier
from-pack: ARM::[email protected]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ build-gen:
- component: ARM::Device:RteTest Generated Component:[email protected]
from-pack: ARM::[email protected]
selected-by: Device:RteTest Generated Component:RteTestGenFiles
files:
- file: ${DEVTOOLS(packs)}/ARM/RteTestGenerator/0.1.0/Include/RteTestInc.h
category: header
version: 1.0.0
generator:
id: RteTestGeneratorIdentifier
from-pack: ARM::[email protected]
Expand Down
Loading