diff --git a/tools/projmgr/include/ProjMgrWorker.h b/tools/projmgr/include/ProjMgrWorker.h index c01ab04c8..a5a494470 100644 --- a/tools/projmgr/include/ProjMgrWorker.h +++ b/tools/projmgr/include/ProjMgrWorker.h @@ -826,7 +826,6 @@ class ProjMgrWorker { bool CollectLayersFromSearchPath(const std::string& clayerSearchPath, StrVecMap& clayers); void GetRequiredLayerTypes(ContextItem& context, LayersDiscovering& discover); bool GetCandidateLayers(LayersDiscovering& discover); - bool ProcessCandidateLayers(ContextItem& context, LayersDiscovering& discover); bool ProcessLayerCombinations(ContextItem& context, LayersDiscovering& discover); bool DiscoverMatchingLayers(ContextItem& context, std::string clayerSearchPath); void CollectConnections(ContextItem& context, ConnectionsCollectionVec& connections); diff --git a/tools/projmgr/src/ProjMgrWorker.cpp b/tools/projmgr/src/ProjMgrWorker.cpp index 9cb993d9a..599d33585 100644 --- a/tools/projmgr/src/ProjMgrWorker.cpp +++ b/tools/projmgr/src/ProjMgrWorker.cpp @@ -730,47 +730,6 @@ void ProjMgrWorker::GetRequiredLayerTypes(ContextItem& context, LayersDiscoverin } } -bool ProjMgrWorker::ProcessCandidateLayers(ContextItem& context, LayersDiscovering& discover) { - // get all candidate layers - if (!GetCandidateLayers(discover)) { - return false; - } - // load device/board specific packs specified in candidate layers - vector packRequirements; - for (const auto& [type, clayers] : discover.candidateClayers) { - for (const auto& clayer : clayers) { - const ClayerItem& clayerItem = m_parser->GetGenericClayers()[clayer]; - if (!clayerItem.forBoard.empty() || !clayerItem.forDevice.empty()) { - InsertPackRequirements(clayerItem.packs, packRequirements, clayerItem.directory); - } - } - } - if (packRequirements.size() > 0) { - AddPackRequirements(context, packRequirements); - if (!LoadAllRelevantPacks() || !LoadPacks(context)) { - PrintContextErrors(context.name); - return false; - } - } - // process board/device filtering - if (!ProcessDevice(context)) { - return false; - } - if (!SetTargetAttributes(context, context.targetAttributes)) { - return false; - } - // recollect layers from packs after filtering - discover.genericClayersFromPacks.clear(); - if (!CollectLayersFromPacks(context, discover.genericClayersFromPacks)) { - return false; - } - discover.candidateClayers.clear(); - if (!GetCandidateLayers(discover)) { - return false; - } - return true; -} - bool ProjMgrWorker::GetCandidateLayers(LayersDiscovering& discover) { // clayers matching required types StrVecMap genericClayers = CollectionUtils::MergeStrVecMap(discover.genericClayersFromSearchPath, discover.genericClayersFromPacks); @@ -805,8 +764,8 @@ bool ProjMgrWorker::DiscoverMatchingLayers(ContextItem& context, string clayerSe } // get required layer types GetRequiredLayerTypes(context, discover); - // process candidate layers - if (!ProcessCandidateLayers(context, discover)) { + // get candidate layers + if (!GetCandidateLayers(discover)) { return false; } // process layer combinations @@ -4106,12 +4065,16 @@ bool ProjMgrWorker::ListLayers(vector& layers, const string& clayerSearc } } } else { - // process precedences - if (!ProcessPrecedences(context)) { + // process precedences and device/board + if (!ProcessPrecedences(context, true)) { failedContexts.insert(selectedContext); error |= true; continue; } + if (!SetTargetAttributes(context, context.targetAttributes)) { + error |= true; + continue; + } // get matching layers for selected context if (!DiscoverMatchingLayers(context, clayerSearchPath)) { failedContexts.insert(selectedContext); diff --git a/tools/projmgr/test/data/TestLayers/genericlayers.csolution.yml b/tools/projmgr/test/data/TestLayers/genericlayers.csolution.yml index 43fe22b88..93fda7596 100644 --- a/tools/projmgr/test/data/TestLayers/genericlayers.csolution.yml +++ b/tools/projmgr/test/data/TestLayers/genericlayers.csolution.yml @@ -22,3 +22,5 @@ solution: packs: - pack: ARM::RteTest - pack: ARM::RteTest_DFP + - pack: ARM::RteTestBoard@0.1.0 + for-context: +BoardSpecific