This repository is a Swift Package for distributing releases of Mozilla's various Rust-based application components. It provides the Swift source code packaged in a format understood by the Swift package manager, and depends on a pre-compiled binary release of the underlying Rust code published from [mozilla/application-services](https://raw.github.com/rfk/rust-components-swift/main/ https://github.com/mozilla/application-service).
For more information, please consult:
ios-rust
crate which is currently
responsible for publishing the pre-built MozillaRustComponents.xcframework.zip
bundle on which this
repository depends.Here's a diagram of how this repository relates to the application-services repository and its release artifacts:
Key points:
rust-components-swift
repo includes the application-services
repo as a git submodule.application-services
repo publishes a binary artifact MozillaRustComponents.xcframework.zip
containing
the Rust code and FFI definitions for all components, compiled together into a single library.Package.swift
file references MozillaRustComponents.xcframework.zip
as a Swift binary target.Package.swift
file defines an individual module for the Swift wrapper code of each component.
MozillaRustComponents
to provide the pre-compiled Rust code.Whenever a new release of the underlying components is availble, we need to tag a new release in this repo to make them available to Swift components. To do so:
./external
to the new release of the underlying components.Package.swift
to update the URL and checksum of MozillaRustComponents.xcframework.zip
../make_tag.sh X.Y.Z
to create the new tag.git push origin X.Y.Z
to publish it to GitHub.To add a new component to be distributed via this repo, you'll need to:
.h
files to the build for the MozillaRustComponents.xcframework.zip
bundle,
following the docs for the ios-rust
crate../external
../generate.sh
script in this repository.
./generate.sh
script
to do it ahead-of-time when publishing a release../Package.swift
to add the new component.
That's it! The component will be included in the next release of this package.
Swift Packages can only be installed from a git repository, but luckily it is possible to use a local checkout for a git repository for local testing.
You may also need to follow the instructions for [locally testing the ios-rust
crate](https://raw.github.com/rfk/rust-components-swift/main/
https://github.com/mozilla/application-services/blob/f3228cf1295154d144be64fc0945c9b3e93a07de/megazords/ios-rust/README.md#testing-locally)
if you need to test changes in the underlying Rust code.
To test out some local changes to this repo:
./make_tag.sh -f 0.0.1
.
https://github.com/mozilla/rust-components-swift
and replace it with a dependency on file:///path/to/your/local/checkout/rust-components-swift
at the 0.0.
release.That's it! The consuming application should be able to import the package from your local checkout.
link |
Stars: 1 |
Last commit: 2 years ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics