-
-
Notifications
You must be signed in to change notification settings - Fork 399
Add Swift bindings and sample apps #834
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tsvvladimir
wants to merge
6
commits into
brainflow-dev:master
Choose a base branch
from
tsvvladimir:feature-swift-bindings
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7fa2f20
Add Swift bindings and sample apps
tsvvladimir cebc28c
Add Xcode iOS demo project
tsvvladimir 5203422
Address Swift binding review feedback
tsvvladimir a5ba117
Harden Swift binding validation
tsvvladimir 08f0601
Add Apple XCFramework artifact workflow
tsvvladimir 0eef31b
Align Apple artifacts with SwiftPM binary release guidance
tsvvladimir File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # Agent Notes | ||
|
|
||
| ## Apple XCFramework Artifacts | ||
|
|
||
| Apple binary artifacts are generated build outputs. They contain framework-wrapped XCFrameworks | ||
| for iOS device, iOS simulator, and macOS app integration, plus a generated | ||
| `BrainFlowSwiftBinaryPackage` for app developers. | ||
|
|
||
| Regenerate the artifacts from the repository root: | ||
|
|
||
| ```bash | ||
| tools/apple/regenerate_artifacts.sh | ||
| ``` | ||
|
|
||
| Verify an existing artifact tree: | ||
|
|
||
| ```bash | ||
| tools/apple/verify_xcframeworks.sh build/apple_xcframeworks | ||
| ``` | ||
|
|
||
| The regeneration script builds native BrainFlow Apple slices, packages the XCFrameworks, verifies | ||
| the required core frameworks, and creates: | ||
|
|
||
| - `BrainFlowAppleXCFrameworks.zip` for complete archive downloads. | ||
| - `SwiftPMArtifacts/*.xcframework.zip` with each `.xcframework` at the ZIP root. | ||
| - `BrainFlowSwiftPackageRemote`, a generated URL-based SwiftPM package manifest. | ||
| - `swiftpm-checksums.txt` and `swiftpm-checksums.json` from `swift package compute-checksum`. | ||
|
|
||
| By default, `tools/apple/regenerate_artifacts.sh` and `tools/apple/build_xcframeworks.sh` write to | ||
| `build/apple_xcframeworks`. Do not commit `build/`, `build_apple/`, `swift_package/Artifacts/Apple`, | ||
| or local `installed/` outputs. | ||
|
|
||
| The iOS demo and macOS packaging script default to `build/apple_xcframeworks/XCFrameworks`. | ||
| CI may override artifact paths with | ||
| `BRAINFLOW_APPLE_XCFRAMEWORKS_DIR`. | ||
|
|
||
| When changing Apple artifact generation, regenerate locally and run verification. CI uploads the | ||
| aggregate archive, the individual SwiftPM `.xcframework.zip` assets, checksums, generated remote | ||
| Swift package, and `manifest.json` as the distributable artifact set. Generated framework headers | ||
| and binaries should come from the scripts, not from files copied into the repository. | ||
|
|
||
| For a BrainFlow release or Apple-library refresh, build from the release commit/tag with | ||
| `BRAINFLOW_VERSION` set. Set `BRAINFLOW_APPLE_RELEASE_BASE_URL` when release assets are hosted | ||
| outside the default GitHub Release tag URL. Regenerate artifacts, verify the generated tree, | ||
| smoke-test the generated Swift binary package, validate the iOS/macOS sample apps against the | ||
| regenerated XCFrameworks, and publish the individual SwiftPM ZIPs next to their checksum files. | ||
| Do not manually patch release frameworks after generation; update source and rerun the script. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add all examples to CI as in brainflow dosc https://brainflow.readthedocs.io/en/stable/Examples.html#python
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in c030c76. I added all documented Swift examples as SwiftPM executable products and added a macOS CI step that runs them all with
BRAINFLOW_LIB_DIR=$GITHUB_WORKSPACE/installed/lib swift run <example>.