Skip to content

feat: enable CoreGraphics polyfill on Android#15

Merged
pedrovgs merged 1 commit into
mainfrom
pedro/android-polyfill
Jun 26, 2026
Merged

feat: enable CoreGraphics polyfill on Android#15
pedrovgs merged 1 commit into
mainfrom
pedro/android-polyfill

Conversation

@pedrovgs

Copy link
Copy Markdown
Member

Summary

Extends every #if os(WASI) || os(Linux) gate in Source/ and Tests/ to also include os(Android) so the pure-Swift CoreGraphics polyfill is selected on Android. The polyfill is Foundation-only — no platform-specific code — so the same path that's been working for WASI/Linux works on Android with no further changes.

Why: downstream packages (GoodNotes/CanvasKit's SVGToNotesItems, CommonNLI's SVG conversion) need this to build on Android. Until now, anywhere that imports SVGToNotesItems either had to #if canImport(SVGToNotesItems) guard the call site or exclude itself from the Android build graph.

Tagged as 0.2.0-goodnotes.

Test plan

  • swift build on Apple unchanged (CoreGraphics path still used).
  • swift build on WASI/Linux unchanged (polyfill path still used).
  • Android build of CanvasKit/CanvasKitAndroid Demo now succeeds with SVGToNotesItems linked.

🤖 Generated with Claude Code

Adds os(Android) alongside os(WASI) and os(Linux) to every gate that
selects the pure-Swift CoreGraphics polyfill. The polyfill is Foundation
only, so it works on Android without further changes; this just opts
the platform in so downstream packages (GoodNotes' SVGToNotesItems,
CommonNLI) can build for Android the same way they already build for
WASI/Linux.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@pedrovgs pedrovgs merged commit 4b96bd1 into main Jun 26, 2026
2 checks passed
@pedrovgs pedrovgs deleted the pedro/android-polyfill branch June 26, 2026 09:57
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