Skip to content

Commit

Permalink
[rtemodel, buildmgr] Update CPRJ target name handling
Browse files Browse the repository at this point in the history
  • Loading branch information
grasci-arm authored Feb 8, 2023
1 parent 7fb0010 commit fd05a6f
Show file tree
Hide file tree
Showing 21 changed files with 13 additions and 10 deletions.
5 changes: 4 additions & 1 deletion libs/rtemodel/src/RteCprjProject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ void RteCprjProject::Initialize()
{
// create target based on cprj description
CprjFile* cprjFile = GetCprjFile();
string targetName = GetName(); // use same name as project
const string& cprjName = GetName();
size_t lastDot = cprjName.find_last_of('.');
const string& targetName = (lastDot != string::npos) && ((lastDot+1) < cprjName.length()) ?
cprjName.substr(lastDot+1) : "Target 1";

XmlItem filterAttributes;
CprjTargetElement* cprjTarget = cprjFile->GetTargetElement();
Expand Down
2 changes: 1 addition & 1 deletion libs/rtemodel/test/src/RteModelTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class RteModelPrjTest : public RteModelTestConfig {
void GenerateHeadersTest(const string& project, const string& rteFolder) {

const string projectDir = RteUtils::ExtractFilePath(project, true);
const string targetFolder = "/_" + RteUtils::ExtractFileBaseName(project) + "/";
const string targetFolder = "/_Target_1/";
const string preIncComp = projectDir + rteFolder + targetFolder + "Pre_Include_RteTest_ComponentLevel.h";
const string preIncGlob = projectDir + rteFolder + targetFolder + "Pre_Include_Global.h";
const string rteComp = projectDir + rteFolder + targetFolder + "RTE_Components.h";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* *** Do not modify ! ***
*
* Project: 'RteTestM3_ConfigFolder'
* Target: 'RteTestM3_ConfigFolder'
* Target: 'Target 1'
*/

#ifndef PRE_INCLUDE_GLOBAL_H
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* *** Do not modify ! ***
*
* Project: 'RteTestM3_ConfigFolder'
* Target: 'RteTestM3_ConfigFolder'
* Target: 'Target 1'
*/

#ifndef PRE_INCLUDE_RTETEST_COMPONENTLEVEL_H
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* *** Do not modify ! ***
*
* Project: 'RteTestM3_ConfigFolder'
* Target: 'RteTestM3_ConfigFolder'
* Target: 'Target 1'
*/

#ifndef RTE_COMPONENTS_H
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* *** Do not modify ! ***
*
* Project: 'RteTestM3'
* Target: 'RteTestM3'
* Target: 'Target 1'
*/

#ifndef PRE_INCLUDE_GLOBAL_H
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* *** Do not modify ! ***
*
* Project: 'RteTestM3'
* Target: 'RteTestM3'
* Target: 'Target 1'
*/

#ifndef PRE_INCLUDE_RTETEST_COMPONENTLEVEL_H
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* *** Do not modify ! ***
*
* Project: 'RteTestM3'
* Target: 'RteTestM3'
* Target: 'Target 1'
*/

#ifndef RTE_COMPONENTS_H
Expand Down
4 changes: 2 additions & 2 deletions tools/buildmgr/cbuild/src/CbuildModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ bool CbuildModel::Create(const CbuildRteArgs& args) {
fs::create_directories(intdir, ec);
}
// generate cpinstall file
string filename = intdir + (intdir.back() == '/' ? "" : "/") + m_targetName + ".cpinstall";
string filename = intdir + (intdir.back() == '/' ? "" : "/") + m_prjName + ".cpinstall";
ofstream missingPacks(filename);
for (const auto& pack : packList) {
const string& packID = pack.vendor + "::" + pack.name + (pack.version.empty() ? "" : "@" + pack.version);
Expand Down Expand Up @@ -163,7 +163,7 @@ void CbuildModel::Init(const string &file, const string &rtePath) {

fs::path name(file);
m_prjName = name.filename().replace_extension("").generic_string();
m_targetName = m_prjName; // project and target have same name
m_targetName = m_cprjProject->GetActiveTargetName();
}

bool CbuildModel::GenerateFixedCprj(const string& update) {
Expand Down

0 comments on commit fd05a6f

Please sign in to comment.