Skip to content

Commit 45548c6

Browse files
authored
[projmgr] Ensure $SolutionDir()$ and $ProjectDir()$ are evaluated
1 parent 447b1e5 commit 45548c6

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

tools/projmgr/src/ProjMgrWorker.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,10 @@ void ProjMgrWorker::AddContext(ContextDesc& descriptor, const TypePair& type, Co
205205
context.variables[RteConstants::AS_BUILD_TYPE] = context.type.build;
206206
context.variables[RteConstants::AS_TARGET_TYPE] = context.type.target;
207207

208+
// solution and project access sequences with absolute paths
209+
context.absPathSequences[RteConstants::AS_SOLUTION_DIR_BR] = context.csolution->directory;
210+
context.absPathSequences[RteConstants::AS_PROJECT_DIR_BR] = context.cproject->directory;
211+
208212
CollectionUtils::PushBackUniquely(m_ymlOrderedContexts, context.name);
209213
m_contexts[context.name] = context;
210214
}

tools/projmgr/test/src/ProjMgrRpcTests.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,8 +1492,10 @@ TEST_F(ProjMgrRpcTests, RpcGetVariables) {
14921492
EXPECT_EQ(vars["Dpack"], testcmsispack_folder + "/ARM/RteTest_DFP/0.2.0/");
14931493
EXPECT_EQ(vars["Pname"], "");
14941494
EXPECT_EQ(vars["Project"], "variables");
1495+
EXPECT_EQ(vars["ProjectDir()"], testinput_folder + "/TestLayers");
14951496
EXPECT_EQ(vars["OutDir()"], testinput_folder + "/TestLayers/out/variables/TargetType1/BuildType1");
14961497
EXPECT_EQ(vars["Solution"], "variables");
1498+
EXPECT_EQ(vars["SolutionDir()"], testinput_folder + "/TestLayers");
14971499
EXPECT_EQ(vars["TargetType"], "TargetType1");
14981500
EXPECT_EQ(vars["VarBuildLayer"], "./variables/build1.clayer.yml");
14991501
EXPECT_EQ(vars["VarSolution"], "./variables/app.clayer.yml");

0 commit comments

Comments
 (0)