Skip to content

[projmgr] Add native CMake project support - #2571

Open
brondani wants to merge 2 commits into
mainfrom
projmgr-cmake-native-project
Open

[projmgr] Add native CMake project support#2571
brondani wants to merge 2 commits into
mainfrom
projmgr-cmake-native-project

Conversation

@brondani

Copy link
Copy Markdown
Collaborator

Fixes

Changes

  • Add cmake project descriptors to solution schemas and parsing, with mutually exclusive CProject, West, and CMake entries.
  • Generate synthetic contexts, CBuild metadata, output image declarations, and CBuild index flags for native CMake projects.
  • Support CMake source paths, generators, configure options, targets, devices, project IDs, and image outputs.
  • Add unit coverage for inferred and explicit project IDs, generated outputs, device selection, and run metadata.

This enables CMSIS solutions to orchestrate native CMake projects without applying CProject-specific processing.

Checklist

  • 🤖 This change is covered by unit tests (if applicable).
  • 🤹 Manual testing has been performed (if necessary).
  • 🛡️ Security impacts have been considered (if relevant).
  • 📖 Documentation updates are complete (if required).
  • 🧠 Third-party dependencies and TPIP updated (if required).

Parse and validate CMake project entries, generate corresponding cbuild
metadata, and handle device and output settings without CMSIS project
processing.
@brondani
brondani force-pushed the projmgr-cmake-native-project branch from 1018c4a to 685b969 Compare August 20, 2026 13:05
@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown

Test Results

  2 files   14 suites   13m 47s ⏱️
481 tests 481 ✅ 0 💤 0 ❌
962 runs  962 ✅ 0 💤 0 ❌

Results for commit a25b6c5.

♻️ This comment has been updated with latest results.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds native CMake project support to ProjMgr so CMSIS solutions can orchestrate non-CProject builds via cmake: project descriptors, emitting the appropriate .cbuild.yml, .cbuild-run.yml, and .cbuild-idx.yml metadata.

Changes:

  • Extends the solution schema + YAML parsing to accept cmake: entries (mutually exclusive with project/west) and carry CMake-specific build metadata (source, generator, configure options, target, images, device).
  • Updates build processing and emitters to treat CMake contexts specially (e.g., skip some CProject-specific nodes, tag .cbuild-idx.yml entries with cmake: true, and map declared CMake images into output metadata).
  • Adds unit test coverage + test data for inferred/explicit CMake project IDs, image outputs, device selection, and generated run/index files.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tools/projmgr/test/src/ProjMgrUnitTests.cpp Adds a unit test validating generated cbuild/cbuild-run/cbuild-idx outputs for CMake projects.
tools/projmgr/test/data/CmakeSupport/solution.csolution.yml Adds test input solution demonstrating cmake: project descriptors (explicit + inferred project-id).
tools/projmgr/src/ProjMgrYamlParser.cpp Parses cmake: descriptors under projects: and extends validation key lists.
tools/projmgr/src/ProjMgrWorker.cpp Adds CMake context initialization, device precedence handling, and output filename/image handling for CMake builds.
tools/projmgr/src/ProjMgrCbuildIdx.cpp Adds cmake: true flag emission and avoids emitting cdefault for CMake contexts.
tools/projmgr/src/ProjMgrCbuild.cpp Emits build.cmake node in generated .cbuild.yml and suppresses non-applicable nodes for CMake contexts.
tools/projmgr/src/ProjMgr.cpp Treats CMake projects as valid “projects found” to avoid false errors.
tools/projmgr/schemas/common.schema.json Adds cmake project schema, project-id constraints, and cmake flags in cbuild-idx/cbuild descriptors.
tools/projmgr/include/ProjMgrYamlParser.h Adds YAML key constants for cmake fields.
tools/projmgr/include/ProjMgrWorker.h Adds CMake descriptor + cmakeOn flag to ContextItem.
tools/projmgr/include/ProjMgrParser.h Introduces CmakeDesc/CmakeImage and tracks cmakeApps in the parsed solution.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tools/projmgr/src/ProjMgrYamlParser.cpp Outdated
Comment thread tools/projmgr/src/ProjMgrYamlParser.cpp
Comment thread tools/projmgr/src/ProjMgrYamlParser.cpp
Comment thread tools/projmgr/src/ProjMgrYamlParser.cpp
@brondani
brondani marked this pull request as ready for review August 20, 2026 15:27
@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.60759% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.13%. Comparing base (9fc7a07) to head (a25b6c5).

Files with missing lines Patch % Lines
tools/projmgr/src/ProjMgrWorker.cpp 85.71% 2 Missing and 2 partials ⚠️
tools/projmgr/src/ProjMgrYamlParser.cpp 87.09% 3 Missing and 1 partial ⚠️
tools/projmgr/src/ProjMgrCbuildIdx.cpp 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2571      +/-   ##
==========================================
+ Coverage   72.09%   72.13%   +0.04%     
==========================================
  Files         185      185              
  Lines       30129    30198      +69     
  Branches    17747    17807      +60     
==========================================
+ Hits        21722    21784      +62     
- Misses       6102     6107       +5     
- Partials     2305     2307       +2     
Flag Coverage Δ
projmgr-cov 88.05% <88.60%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
tools/projmgr/include/ProjMgrParser.h 100.00% <ø> (ø)
tools/projmgr/include/ProjMgrWorker.h 83.87% <ø> (ø)
tools/projmgr/src/ProjMgr.cpp 86.55% <100.00%> (ø)
tools/projmgr/src/ProjMgrCbuild.cpp 93.62% <100.00%> (+0.19%) ⬆️
tools/projmgr/src/ProjMgrCbuildIdx.cpp 96.17% <66.66%> (+0.04%) ⬆️
tools/projmgr/src/ProjMgrWorker.cpp 87.57% <85.71%> (-0.01%) ⬇️
tools/projmgr/src/ProjMgrYamlParser.cpp 85.06% <87.09%> (+0.07%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@brondani
brondani requested a review from edriouk August 20, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants