buffa_reflect_build/lib.rs
1//! Build-script integration for `buffa-reflect`.
2//!
3//! Drives [`buffa_build`] to compile `.proto` files, additionally:
4//!
5//! * emits `OUT_DIR/file_descriptor_set.bin` (a wire-compatible
6//! `google.protobuf.FileDescriptorSet`),
7//! * decorates every generated message struct with `#[derive(::buffa_reflect::ReflectMessage)]` and
8//! a `#[buffa_reflect(...)]` attribute that wires it back to either a user-supplied descriptor
9//! pool or the embedded descriptor bytes.
10//!
11//! See the crate-level `Builder` type for the full surface.
12//!
13//! ## Why sync std I/O / `Command` here
14//!
15//! This crate runs from `build.rs`, which cargo invokes synchronously
16//! without a tokio runtime. `tokio::fs` / `tokio::process::Command` would
17//! force every consumer to spin up a runtime in their build script for no
18//! benefit. The workspace clippy lint banning sync I/O is therefore
19//! suppressed at this crate's root with full justification.
20
21#![allow(
22 clippy::disallowed_types,
23 clippy::disallowed_methods,
24 reason = "build scripts and codegen run synchronously; pulling in a tokio runtime here would \
25 burden every downstream build.rs."
26)]
27
28mod builder;
29
30pub use crate::builder::{Builder, Error};