diff --git a/tools/projmgr/src/ProjMgrWorker.cpp b/tools/projmgr/src/ProjMgrWorker.cpp index dd34c60e6..dea007f25 100644 --- a/tools/projmgr/src/ProjMgrWorker.cpp +++ b/tools/projmgr/src/ProjMgrWorker.cpp @@ -203,7 +203,9 @@ bool ProjMgrWorker::ParseContextLayers(ContextItem& context) { if (!variable.empty()) { context.layerVariables[clayer.type] = variable; } - string clayerFile = RteUtils::ExpandAccessSequences(clayer.layer, context.variables); + auto variables = context.variables; + variables[RteConstants::AS_SOLUTION_DIR_BR] = context.csolution->directory; + string clayerFile = RteUtils::ExpandAccessSequences(clayer.layer, variables); if (clayerFile.empty()) { continue; } diff --git a/tools/projmgr/test/data/TestLayers/ref/variables/variables.cbuild-idx.yml b/tools/projmgr/test/data/TestLayers/ref/variables/variables.cbuild-idx.yml index 1ba3a88ee..43af99ad1 100644 --- a/tools/projmgr/test/data/TestLayers/ref/variables/variables.cbuild-idx.yml +++ b/tools/projmgr/test/data/TestLayers/ref/variables/variables.cbuild-idx.yml @@ -9,6 +9,7 @@ build-idx: - clayer: ../data/TestLayers/$VarTargetLayer$ - clayer: ../data/TestLayers/$VarSolution$ - clayer: ../data/TestLayers/$VarSolutionDir$ + - clayer: ../data/TestLayers/$SolutionDir()$/variables/solutionDir2.clayer.yml cbuilds: - cbuild: variables.BuildType1+TargetType1.cbuild.yml project: variables @@ -17,6 +18,7 @@ build-idx: - clayer: ../data/TestLayers/variables/app.clayer.yml - clayer: ../data/TestLayers/variables/build1.clayer.yml - clayer: ../data/TestLayers/variables/solutionDir.clayer.yml + - clayer: ../data/TestLayers/variables/solutionDir2.clayer.yml - clayer: ../data/TestLayers/variables/target1.clayer.yml messages: info: @@ -29,6 +31,7 @@ build-idx: - clayer: ../data/TestLayers/variables/app.clayer.yml - clayer: ../data/TestLayers/variables/build1.clayer.yml - clayer: ../data/TestLayers/variables/solutionDir.clayer.yml + - clayer: ../data/TestLayers/variables/solutionDir2.clayer.yml - clayer: ../data/TestLayers/variables/target2.clayer.yml messages: info: @@ -41,6 +44,7 @@ build-idx: - clayer: ../data/TestLayers/variables/app.clayer.yml - clayer: ../data/TestLayers/variables/build2.clayer.yml - clayer: ../data/TestLayers/variables/solutionDir.clayer.yml + - clayer: ../data/TestLayers/variables/solutionDir2.clayer.yml - clayer: ../data/TestLayers/variables/target1.clayer.yml messages: info: @@ -53,6 +57,7 @@ build-idx: - clayer: ../data/TestLayers/variables/app.clayer.yml - clayer: ../data/TestLayers/variables/build2.clayer.yml - clayer: ../data/TestLayers/variables/solutionDir.clayer.yml + - clayer: ../data/TestLayers/variables/solutionDir2.clayer.yml - clayer: ../data/TestLayers/variables/target2.clayer.yml messages: info: diff --git a/tools/projmgr/test/data/TestLayers/variables.cproject.yml b/tools/projmgr/test/data/TestLayers/variables.cproject.yml index 5e20170bf..3e264f645 100644 --- a/tools/projmgr/test/data/TestLayers/variables.cproject.yml +++ b/tools/projmgr/test/data/TestLayers/variables.cproject.yml @@ -6,3 +6,4 @@ project: - layer: $VarTargetLayer$ - layer: $VarSolution$ - layer: $VarSolutionDir$ + - layer: $SolutionDir()$/variables/solutionDir2.clayer.yml diff --git a/tools/projmgr/test/data/TestLayers/variables/solutionDir2.clayer.yml b/tools/projmgr/test/data/TestLayers/variables/solutionDir2.clayer.yml new file mode 100644 index 000000000..26dbc30a4 --- /dev/null +++ b/tools/projmgr/test/data/TestLayers/variables/solutionDir2.clayer.yml @@ -0,0 +1,6 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/projmgr/schemas/clayer.schema.json + +layer: + + define: + - SolutionDir-Layer