Skip to content

refactor: organize native sources and header exports - #39

Merged
Kyle-Ye merged 3 commits into
mainfrom
optimize/layout
Nov 7, 2026
Merged

Kyle-Ye merged 3 commits into
mainfrom
optimize/layout

Conversation

@Kyle-Ye

@Kyle-Ye Kyle-Ye commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Native C++ and Objective-C headers were separated from their implementations, and new exported headers required several manual updates. Group native code by feature while keeping the public <OpenRenderBox/...> include paths.

  • Keep one source file for each public header and expose it through a relative symbolic link. Preserve the module language requirements for Linux and Darwin.
  • Build OpenRenderBoxCxx as a static library linked into the dynamic OpenRenderBox.framework. Derive the framework module map from the SwiftPM map and copy real header contents into the bundle. Export the fixed CoreGraphics backend configuration so clients can use path APIs without extra compiler flags.
  • Add Scripts/add_header.py <header> <module> to create public links and register headers. Repeated calls are safe, and conflicts leave existing files intact.
  • Export template headers under Headers and exclude them from Tuist resource bundles. Update the header template script and document header registration.

Validation:

  • Header helper: 10 tests passed on Linux and macOS, including repeat calls, missing links, conflicts, and C++ template headers.

  • SwiftPM build and test passed on both platforms. Linux: 21 tests, with 2 existing known issues. macOS: 28 passed and 37 skipped.

  • macOS Release framework build passed. Standalone C, C++, Objective-C, and Swift consumers passed using a copied bundle and its Swift interface.

  • Newly registered headers and template headers were also built and checked in a separate framework fixture.

  • Path APIs passed standalone header checks and consumer tests without a backend compiler flag. A conflicting framework backend flag is rejected.

  • macOS SwiftPM also builds with OPENRENDERBOX_CF_CGTYPES=0.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T09:57:35.962499Z b1005fa New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: caeb4de569

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Project.swift
Comment on lines +56 to +57
"GCC_PREPROCESSOR_DEFINITIONS": ["$(inherited)", "OPENRENDERBOX_CF_CGTYPES"],
"SWIFT_ACTIVE_COMPILATION_CONDITIONS": ["$(inherited)", "OPENRENDERBOX_CF_CGTYPES"],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Export the framework's backend configuration to consumers

For standalone framework consumers, these project-level definitions are not propagated when importing the copied bundle. The exported ORBPath.h, ORBPathCallbacks.h, and ORBPathStorage.h all guard their declarations with #if OPENRENDERBOX_CF_CGTYPES, but neither the exported headers nor the generated framework module map defines that macro. Consequently, the framework builds its native path implementation while ordinary C and Swift consumers cannot see its path API unless they manually supply an undocumented build flag. Encode the framework's fixed backend configuration in its exported headers so clients see the same API that was built; the current framework client test only exercises color and animation APIs and misses this mismatch.

Useful? React with 👍 / 👎.

@codecov-commenter

codecov-commenter commented Nov 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 25.38%. Comparing base (0bb9980) to head (b1005fa).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #39   +/-   ##
=======================================
  Coverage   25.38%   25.38%           
=======================================
  Files          14       14           
  Lines         524      524           
=======================================
  Hits          133      133           
  Misses        391      391           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Kyle-Ye
Kyle-Ye merged commit a0d184a into main Nov 7, 2026
4 checks passed
@Kyle-Ye
Kyle-Ye deleted the optimize/layout branch November 7, 2026 10:22
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