[Darwin] add private umbrella header#43126
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a private umbrella header and module map for the Darwin Matter framework. This is a good architectural improvement that allows for cleaner, framework-style imports of private headers within the framework itself. The changes to the ZAP templates correctly update the import statements to use the new module structure. The new files and project settings are correctly configured. The changes are well-contained and look correct.
`MTRCommandPayloads_Private.h` is a misnomer; it's Project scoped.
|
PR #43126: Size comparison from 07f6efb to 64c3fa5 Full report (6 builds for cc32xx, nrfconnect, realtek, stm32)
|
|
PR #43126: Size comparison from 07f6efb to de7befd Full report (31 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
|
PR #43126: Size comparison from 07f6efb to ec774a8 Full report (35 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
|
PR #43126: Size comparison from 07f6efb to 289360a Full report (35 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
|
PR #43126: Size comparison from 07f6efb to 397c236 Full report (35 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
There was a problem hiding this comment.
Pull request overview
This PR updates the Darwin Matter.framework packaging to properly support private headers via a dedicated private umbrella header and private modulemap, while also aligning generated/private header templates to consistently use framework-style imports.
Changes:
- Add a private umbrella header (
Matter_Private.h) and private modulemap (Matter_Private.modulemap) and wire them into the Xcode project / build settings. - Update ZAP templates and corresponding generated private headers to use
<Matter/...>import style (instead of local"..."includes). - Ensure private cluster constants/enums and private cluster interfaces have consistent availability annotations / non-empty enum definitions.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/darwin/Framework/Matter.xcodeproj/project.pbxproj | Adds the new private umbrella header and private modulemap to the project, and installs Matter_Private.h as a private header. |
| src/darwin/Framework/Configs/Matter.xcconfig | Enables use of a private module map via MODULEMAP_PRIVATE_FILE. |
| src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Private.h | Switches private header import to framework-style <Matter/...> include. |
| src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc_Private.h | Switches private structs header import to framework-style <Matter/...> include. |
| src/darwin/Framework/CHIP/zap-generated/MTRClusters_Private.h | Switches imports to framework-style <Matter/...> includes for consistency. |
| src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants_Private.h | Adds reserved enum values (to avoid empty enums) with consistent availability annotation. |
| src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Private.h | Switches private payload header import to framework-style <Matter/...> include. |
| src/darwin/Framework/CHIP/templates/MTRCommandPayloads_Private.zapt | Updates template import style to <Matter/...>. |
| src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc_Private.zapt | Updates template import style to <Matter/...>. |
| src/darwin/Framework/CHIP/templates/MTRClusters_Private.zapt | Updates template import style and marks private clusters as MTR_PROVISIONALLY_AVAILABLE. |
| src/darwin/Framework/CHIP/templates/MTRClusterConstants_Private.zapt | Adds reserved enum values in the template to prevent empty enums. |
| src/darwin/Framework/CHIP/templates/MTRBaseClusters_Private.zapt | Updates template import style to <Matter/...>. |
| src/darwin/Framework/CHIP/Matter_Private.modulemap | Introduces a private framework module with a private umbrella header and an explicit submodule. |
| src/darwin/Framework/CHIP/Matter_Private.h | Introduces the private umbrella header that aggregates key private headers. |
|
fast-tracking platform-specific change with platform owner review |
|
PR #43126: Size comparison from e021a36 to 79842b1 Full report (35 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
Summary
Related issues
n/a
Testing
against
397c2365b8d1bfe7112982dca512db905e8b396axcodebuildofMatter.frameworkxcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosxReadability checklist
The checklist below will help the reviewer finish PR review in time and keep the
code readable:
descriptive
“When in Rome…”
rule (coding style)
See: Pull Request Guidelines