Skip to content

feat(pdfx): add Swift Package Manager support - #623

Merged
vicajilau merged 3 commits into
ScerIO:mainfrom
vinnyt:pdfx-swift-package-manager
Aug 20, 2026
Merged

feat(pdfx): add Swift Package Manager support#623
vicajilau merged 3 commits into
ScerIO:mainfrom
vinnyt:pdfx-swift-package-manager

Conversation

@vinnyt

@vinnyt vinnyt commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • adds Swift Package Manager support for pdfx on iOS and macOS
  • consolidates the duplicated Apple implementation into shared Darwin sources
  • splits the Objective-C Pigeon bridge from the Swift target as required by SwiftPM
  • retains and validates CocoaPods compatibility
  • updates Pigeon generation paths for the shared source layout

Validation

Validated with Flutter 3.44.9:

  • flutter test: all 7 tests pass
  • iOS simulator debug build using SwiftPM
  • macOS debug build using SwiftPM
  • iOS simulator debug build with SwiftPM disabled, using CocoaPods
  • macOS debug build with SwiftPM disabled, using CocoaPods

@adrianjagielak adrianjagielak 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.

LGTM @vicajilau

@emakar

emakar commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

@vinnyt please resolve the conflicts?

Comment thread packages/pdfx/darwin/pdfx/Package.swift Outdated
flutterFramework,
"pdfx_messages"
],
path: "Sources/pdfx"

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 333d4a0. I moved the generated Objective-C bridge under darwin/pdfx/Sources/pdfx/messages and updated both Package.swift and the Pigeon output paths. It remains a separate pdfx_messages target, nested beneath the plugin source folder and excluded from the Swift target, because SwiftPM does not support mixing Swift and Objective-C sources in one target. Verified with iOS and macOS SwiftPM builds on Flutter 3.44.9.

@vinnyt
vinnyt force-pushed the pdfx-swift-package-manager branch from 2e939f7 to 333d4a0 Compare August 20, 2026 09:45
The CocoaPods podspec advertised iOS 8.0/macOS 10.11 while the new
SwiftPM manifest requires iOS 13.0/macOS 10.15 for the same source,
which could mislead apps integrating via CocoaPods on older OS
versions. Also deduplicates the shared DEFINES_MODULE xcconfig entry
and adds the pending CHANGELOG entry for this PR.
@vicajilau
vicajilau merged commit 9e7660e into ScerIO:main Aug 20, 2026
2 checks passed
@vicajilau

Copy link
Copy Markdown
Member

Thanks for the great contribution, this is a solid addition to pdfx. Appreciate the thorough validation across SwiftPM and CocoaPods paths.

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.

4 participants