@@ -103,7 +103,9 @@ void RteTarget::Clear()
103103 ClearFilteredComponents ();
104104 ClearCollections ();
105105 ClearMissingPacks ();
106- m_filteredModel->Clear ();
106+ if (m_filteredModel) {
107+ m_filteredModel->Clear ();
108+ }
107109 m_filterContext->Clear ();
108110 m_dependencySolver->Clear ();
109111 m_bTargetSupported = false ;
@@ -131,7 +133,11 @@ std::string RteTarget::ExpandAccessSequences(const std::string& src) const
131133 const string& compiler = GetAttribute (" Tcompiler" );
132134 attributes.AddAttribute (RteConstants::AS_COMPILER, (compiler == " ARMCC" ) ? " AC6" : compiler);
133135 // target name as target type
134- attributes.AddAttribute (RteConstants::AS_TARGET_TYPE, GetName ());
136+ string targetType = RteUtils::GetSuffix (GetName (), ' +' );
137+ if (targetType.empty ()) {
138+ targetType = GetName ();
139+ }
140+ attributes.AddAttribute (RteConstants::AS_TARGET_TYPE, targetType);
135141 attributes.AddAttribute (RteConstants::AS_BUILD_TYPE, RteUtils::EMPTY_STRING);
136142
137143 // project and solution
@@ -140,10 +146,17 @@ std::string RteTarget::ExpandAccessSequences(const std::string& src) const
140146 attributes.AddAttribute (RteConstants::AS_PROJECT, projectName);
141147 string projectDir = RteUtils::RemoveTrailingBackslash (project->GetProjectPath ());
142148
149+ string solutionName;
150+ string solutionDir;
143151 RteModel* globalModel = GetModel ();
144- string solutionDir = globalModel->GetRootFilePath (false ); // solution filename
152+ solutionName = RteUtils::ExtractFileBaseName ( // removes .csolution
153+ RteUtils::ExtractFileBaseName (globalModel->GetRootFileName ()) // removes .yml
154+ );
155+ solutionDir = globalModel->GetRootFilePath (false );
156+
145157 if (solutionDir.empty ()) {
146158 solutionDir = projectDir;
159+ solutionName = projectName;
147160 projectDir = " ." ;
148161 } else {
149162 projectDir = RteFsUtils::RelativePath (projectDir, solutionDir);
@@ -153,6 +166,7 @@ std::string RteTarget::ExpandAccessSequences(const std::string& src) const
153166 attributes.AddAttribute (RteConstants::AS_PROJECT_DIR_BR, projectDir);
154167 attributes.AddAttribute (RteConstants::AS_SOLUTION_DIR, solutionDir);
155168 attributes.AddAttribute (RteConstants::AS_SOLUTION_DIR_BR, solutionDir);
169+ attributes.AddAttribute (RteConstants::AS_SOLUTION, solutionName);
156170
157171 return RteUtils::ExpandAccessSequences (src, attributes.GetAttributes ());
158172}
@@ -752,15 +766,14 @@ void RteTarget::CollectComponentSettings(RteComponentInstance* ci)
752766 const set<RteFile*>& files = GetFilteredFiles (c);
753767 if (files.empty ())
754768 return ;
755- string deviceName = GetFullDeviceName ();
756769 const string& rteFolder = GetRteFolder (ci);
757770 for (auto itf = files.begin (); itf != files.end (); ++itf) {
758771 RteFile* f = *itf;
759772 if (!f)
760773 continue ;
761774 if (f->IsConfig ()) {
762775 for (int i = 0 ; i < count; i++) {
763- string id = f->GetInstancePathName (deviceName , i, rteFolder);
776+ string id = f->GetInstancePathName (this , i, rteFolder);
764777 AddComponentInstanceForFile (id, ci);
765778 }
766779 continue ;
@@ -1467,18 +1480,17 @@ RteItem* RteTarget::GetFile(const RteFileInstance* fi, RteComponent* c, const st
14671480 if (!fi) {
14681481 return nullptr ;
14691482 }
1470- const string& deviceName = GetFullDeviceName ();
14711483 const string& instanceName = fi->GetInstanceName ();
14721484 if (c) { // a component file
14731485 int index = fi->GetInstanceIndex ();
14741486 for (auto f : GetFilteredFiles (c)) {
1475- if (f && f->GetInstancePathName (deviceName , index, rteFolder) == instanceName) {
1487+ if (f && f->GetInstancePathName (this , index, rteFolder) == instanceName) {
14761488 return f;
14771489 }
14781490 }
14791491 } else {
14801492 auto debugVars = GetDeviceDebugVars ();
1481- if (debugVars && debugVars->GetInstancePathName (deviceName , 0 , rteFolder) == instanceName) {
1493+ if (debugVars && debugVars->GetInstancePathName (this , 0 , rteFolder) == instanceName) {
14821494 return debugVars;
14831495 }
14841496 }
0 commit comments