Add Swift Package interface wrapping the C library#61
Conversation
- Added `Package.swift` at the root to configure the Swift package - Created `WorldAlphabetsC` target referencing the C source code - Created `WorldAlphabets` Swift target wrapping the C functionality - Added native Swift types mapping to C structures - Implemented Swift tests to verify the wrapper - Updated GitHub Actions to run Swift tests on push Co-authored-by: willwade <229352+willwade@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- Corrected the C-interop logic when passing an array of `UnsafePointer<CChar>?` to a C function expecting a double pointer. - Used `withUnsafeMutableBufferPointer` to safely obtain the base address of the Swift array to satisfy the compiler requirements. Co-authored-by: willwade <229352+willwade@users.noreply.github.com>
|
Docs / read me needs updating |
I have updated the README.md to mention the Swift interface, included an SPM badge, and added a Swift usage section with code examples. |
- Added Swift Package Manager badge to README. - Updated main description to include the Swift interface. - Added a Swift Usage section containing installation instructions and basic code examples. Co-authored-by: willwade <229352+willwade@users.noreply.github.com>
|
im still seeing errors in the "Lint and Test / Test Swift (push)" |
I see the test error related to |
- Added `cSettings` with `.headerSearchPath` directives for both `generated` and `include` directories. - This resolves build failures where the C compiler in Swift Package Manager cannot locate the generated headers (like `worldalphabets_data.h`) when compiling the C source files. Co-authored-by: willwade <229352+willwade@users.noreply.github.com>
This commit adds a native Swift interface that wraps the existing C library, allowing the project to be consumed as a Swift Package via Swift Package Manager (SPM).
The wrapper provides an idiomatic Swift API parity with the Python and Node interfaces. Due to SPM's path constraints,
Package.swiftwas placed at the repository root. Tests have been written for all key functional areas and integrated into the GitHub Actions CI workflow.PR created automatically by Jules for task 14334735343406533808 started by @willwade