Skip to content
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
8 changes: 8 additions & 0 deletions libs/rtemodel/include/RtePackage.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ class RtePackage : public RteRootItem
*/
const std::string& GetPackageFileName() const override { return GetRootFileName(); }


/**
* @brief get path to overview document
* @return file path
*/
const std::string& GetDocValue() const override;


/**
* @brief get pack common ID, also known as 'pack family ID', does not contain version
* @return ID string in the form PackVendor.PackName
Expand Down
5 changes: 5 additions & 0 deletions libs/rtemodel/src/RtePackage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ void RtePackage::Clear()
RteItem::Clear();
}

const std::string& RtePackage::GetDocValue() const
{
return GetChildAttribute("description", "overview");
}

bool RtePackage::IsDeprecated() const
{
if (m_nDeprecated >= 0)
Expand Down
15 changes: 15 additions & 0 deletions libs/rteutils/include/CollectionUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,21 @@ bool contains_key(const M& m, const typename M::key_type& k) {
return m.find(k) != m.end();
}

/**
* @brief Returns set of key in the map
* @tparam M template parameter representing a map
* @param m a key-value map
* @return std::set of keys
*/
template <typename M>
auto key_set(const M& m) {
using Key = typename M::key_type;
std::set<Key> ks;
for (const auto& kv : m)
ks.insert(kv.first);
return ks;
}

/**
* @brief string pair
*/
Expand Down
4 changes: 2 additions & 2 deletions tools/projmgr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ include(FetchContent)
FetchContent_Declare(
rpc-interface
DOWNLOAD_EXTRACT_TIMESTAMP ON
URL https://github.com/Open-CMSIS-Pack/csolution-rpc/releases/download/v0.0.5/csolution-rpc.zip
URL_HASH SHA256=94bd65ec0f8054dc7685a60812f00bc32cc7f9227bec5abdbaa7215fb6b6bd27
URL https://github.com/Open-CMSIS-Pack/csolution-rpc/releases/download/v0.0.6/csolution-rpc.zip
URL_HASH SHA256=86bce42eaef998cb37f3623931068056625d471e80032695946081531359ba5f
)
FetchContent_MakeAvailable(rpc-interface)

Expand Down
7 changes: 6 additions & 1 deletion tools/projmgr/include/ProjMgrRpcServerData.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@

#include <optional>
#include <list>
#include <set>

using namespace std;

using PackReferenceVector = std::vector<RpcArgs::PackReference>;

class RteTarget;
class RteBundle;
class RteComponent;
Expand All @@ -30,7 +33,9 @@ class RpcDataCollector {
RteTarget* GetTarget() const { return m_target; }

void CollectCtClasses(RpcArgs::CtRoot& ctRoot) const;
void CollectUsedItems(RpcArgs::UsedItems& usedItems) const;
void CollectUsedComponents(vector< RpcArgs::ComponentInstance>& usedComponents) const;

std::set<std::string> GetUsedPacks() const;

void CollectDeviceList(RpcArgs::DeviceList& deviceList, const std::string& namePattern, const std::string& vendor) const;
void CollectDeviceInfo(RpcArgs::DeviceInfo& deviceInfo, const std::string& id) const;
Expand Down
7 changes: 4 additions & 3 deletions tools/projmgr/include/ProjMgrWorker.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ struct PackageItem {
PackInfo pack;
std::string path;
std::string origin;
std::string selectedBy;
};

/**
Expand Down Expand Up @@ -522,7 +523,7 @@ struct ContextItem {
RtePackage* devicePack = nullptr;
RtePackage* boardPack = nullptr;
bool precedences;
std::map<std::string, std::set<std::string>> userInputToResolvedPackIdMap;
std::map<std::string, std::map<std::string, PackageItem> > userInputToResolvedPackIdMap;
StrSet localPackPaths;
StrVec dependsOn;
std::map<std::string, RteItem*> packLayers;
Expand Down Expand Up @@ -1070,7 +1071,7 @@ class ProjMgrWorker {
/**
* @brief collect examples
* @param context item
* @param environments filter
* @param environments filter
* @return vector of example items
*/
std::vector<ExampleItem> CollectExamples(const ContextItem& context, const StrVec& filter);
Expand All @@ -1081,7 +1082,7 @@ class ProjMgrWorker {
* @return vector of template items
*/
std::vector<TemplateItem> CollectTemplates(const ContextItem& context);

/**
* @brief check if all selected contexts have lib output
* @param reference to processed contexts
Expand Down
2 changes: 1 addition & 1 deletion tools/projmgr/src/ProjMgrCbuildPack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ ProjMgrCbuildPack::ProjMgrCbuildPack(YAML::Node node, const vector<ContextItem*>
// Stage 3: Add all user input expression on the matching resolved pack
for (const auto& context : processedContexts) {
for (const auto& [userInput, resolvedPacks] : context->userInputToResolvedPackIdMap) {
for (const auto& resolvedPack : resolvedPacks) {
for (const auto& [resolvedPack, _] : resolvedPacks) {
if (model.find(resolvedPack) == model.end()) {
ModelItem modelItem;
ProjMgrUtils::ConvertToPackInfo(resolvedPack, modelItem.info);
Expand Down
Loading
Loading