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
11 changes: 6 additions & 5 deletions tools/projmgr/src/ProjMgrWorker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,14 @@ bool ProjMgrWorker::AddContexts(ProjMgrParser& parser, ContextDesc& descriptor,
void ProjMgrWorker::UpdateTmpDir() {
auto& tmpdir = m_parser->GetCsolution().directories.tmpdir;
auto& base = m_outputDir.empty() ? m_parser->GetCsolution().directory : m_outputDir;
if (!tmpdir.empty()) {
if (!m_activeTargetType.empty()) {
tmpdir = RteUtils::ExpandAccessSequences(tmpdir, {
if (!m_activeTargetType.empty()) {
const auto& targetSet = m_activeTargetSet.set.empty() ? "default" : m_activeTargetSet.set;
// default tmpdir: tmp/$TargetType$/$TargetSet$
tmpdir = tmpdir.empty() ? "tmp/" + m_activeTargetType + "/" + targetSet :
RteUtils::ExpandAccessSequences(tmpdir, {
Comment thread
brondani marked this conversation as resolved.
{ RteConstants::AS_TARGET_TYPE, m_activeTargetType },
{ RteConstants::AS_TARGET_SET, m_activeTargetSet.set.empty() ? "default" : m_activeTargetSet.set } }
{ RteConstants::AS_TARGET_SET, targetSet } }
);
}
}
tmpdir = base + "/" + (tmpdir.empty() ? "tmp" : tmpdir);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ build-idx:
generated-by: csolution version 0.0.0
csolution: image-only.csolution.yml
cbuild-run: out/image-only+CM0.cbuild-run.yml
tmpdir: tmp
tmpdir: tmp/CM0/default
image-only: true
cbuilds:
- cbuild: out/image-only/CM0/image-only+CM0.cbuild.yml
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/main/tools/projmgr/schemas/csolution.schema.json

solution:

compiler: AC6

target-types:
- type: TypeA
target-set:
- set: Set1
images:
- project-context: test1.Debug

build-types:
- type: Debug

projects:
- project: ./TestProject1/test1.cproject.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ build-idx:
generated-by: csolution version 0.0.0
csolution: solution.csolution.yml
cbuild-run: out/solution+CM0.cbuild-run.yml
tmpdir: tmp
tmpdir: tmp/CM0/default
cbuilds:
- cbuild: out/core0/CM0/Debug/core0.Debug+CM0.cbuild.yml
west: true
Expand Down
14 changes: 14 additions & 0 deletions tools/projmgr/test/src/ProjMgrUnitTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4388,6 +4388,20 @@ TEST_F(ProjMgrUnitTests, OutputDirsTmpdirAccessSequence) {
EXPECT_EQ("tmp/TypeA/Set1", cbuild["build-idx"]["tmpdir"].as<string>());
}

TEST_F(ProjMgrUnitTests, OutputDirsTmpdirDefault) {
char* argv[5];
const string& csolution = testinput_folder + "/TestSolution/tmpdir-default-active.csolution.yml";
argv[1] = (char*)"convert";
argv[2] = (char*)csolution.c_str();
argv[3] = (char*)"--active";
argv[4] = (char*)"TypeA@Set1";
EXPECT_EQ(0, RunProjMgr(5, argv, m_envp));

// Check default tmp directory for active target type and target set
const YAML::Node& cbuild = YAML::LoadFile(testinput_folder + "/TestSolution/tmpdir-default-active.cbuild-idx.yml");
EXPECT_EQ("tmp/TypeA/Set1", cbuild["build-idx"]["tmpdir"].as<string>());
}

TEST_F(ProjMgrUnitTests, OutputDirsAbsolutePath) {
StdStreamRedirect streamRedirect;
char* argv[5];
Expand Down
Loading