eb1f268654
Bumped UniFFI to 0.28.2 Added a tool to run uniffi-bindgen in library mode. It can input either a specific library path or the megazord crate name. Use that simplify several build scripts -- especially the generate docs ones. The best part of this is that we no longer have to maintain hand-written modulemaps, which makes adding a new component harder than it needs to be. Split out the uniffi-bindgen commands from `build-xcframework.sh`. This way you can run them standalone and see the results, even if you don't have XCode setup. One change is that automation/swift-components-docs/generate-swift-project.sh now uses `megazord_ios` rather than `megazord`. I think this should result in slightly more accurate docs, since historically some components in the Android megazord aren't in the iOS one (Although, I think they match at the present). |
||
---|---|---|
.. | ||
android | ||
src | ||
Cargo.toml | ||
README.md | ||
build.rs | ||
uniffi.toml |
README.md
Crash Testing Helper APIs
This is a little helper component to make it easier to debug issues with crash reporting, by letting you deliberately crash a consuming app.
Features
The Crash Testing Helper APIs let you deliberately crash your application in a variety of ways:
- By triggering a hard abort inside the Rust code of the component, which should surface as a crash of the application.
- By triggering a panic inside the Rust code of the component, which should surface as an "internal error" exception to the calling code.
The component does not offer any support for crash reporting, debugging etc itself, it's just designed to let you more easily test those things in your application.
Using the Crash Testing Helper APIs
Before using this component
This component does not currently integrate with the Glean SDK and does not submit any telemetry, so you do not need to request a data-review before using this component.
Prerequisites
To use this component, you should be familiar with how to integrate application-services components into an application on your target platform:
- Android: Add the
mozilla.appservices.crashtest
package as a gradle dependency, but make sure you're using the same version of application-services as used by Android Components. - iOS: start with the guide to consuming rust components on iOS.
- Other Platforms: we don't know yet; please reach out on slack to discuss!
Component API
For details on how to use this component, consult the public interface definition or view the generated Rust API documentation by running:
cargo doc --no-deps --open
Working on the Crash Testing Helper APIs
Prerequisites
To effectively work on the Crash Testing Helper APIs, you will need to be familiar with:
- Our general guidelines for contributors.
- The way we use uniffi-rs to generate API wrappers for multiple languages, such as Kotlin and Swift.
Overview
This component uses uniffi-rs to create its public API surface in Rust, and then generate bindings for Kotlin and Swift. The code is organized as follows:
- The public API surface is implemented in
./src/lib.rs
, with matching declarations in./src/crashtest.udl
to define how it gets exposed to other languages. - The
./android/
directory contains android-specific build scripts that generate Kotlin wrappers and publish them as an AAR, and some Android tests. - The
./ios/
directory is a placeholder for generated Swift code. There are a couple of Swift tests in/megazords/ios-rust/MozillaTestServicesTests/CrashTestTests.swift
.
Detailed Docs
We use rustdoc to document both the public API of this component and its various internal implementation details. View the docs by running:
cargo doc --no-deps --document-private-items --open