rsbinder-aidl
This is an AIDL compiler for rsbinder.
How to use the AIDL Code Generator
Add dependencies to Cargo.toml:
[]
= "0.6"
[]
= { = "0.6", = ["async"] }
Create a build.rs file:
use PathBuf;
Sync-only Setup
For environments without async runtime:
[]
= { = "0.6", = false }
[]
= "0.6"
Error Reporting
rsbinder-aidl uses miette for structured error reporting.
When an AIDL file contains a syntax or semantic error, the compiler reports the file name,
line number, source snippet, and a helpful message:
× AIDL Parse Error [aidl::parse_error]
╭─[hello.aidl:5:12]
4 │ interface IHello {
5 │ void 123bad();
· ^^^^^^ expected identifier
6 │ }
╰────
help: method names must start with a letter or underscore
To enable fancy (colored, Unicode) output in a binary, call miette::set_hook() at startup:
In a build.rs, simply wrap the error with miette::Report and print to stderr:
How to create AIDL file
Please read Android AIDL documents.