Skip to content

proto-build: split into a library and binary#268

Merged
bmwill merged 1 commit into
masterfrom
proto-build-lib
May 31, 2026
Merged

proto-build: split into a library and binary#268
bmwill merged 1 commit into
masterfrom
proto-build-lib

Conversation

@bmwill

@bmwill bmwill commented May 31, 2026

Copy link
Copy Markdown
Collaborator

Previously, proto-build was a binary-only crate with all codegen modules and the driver logic living in main.rs. With this commit, the codegen modules move into a new library target so they can be reused by other crates, while main.rs retains the driver entry point and reaches the modules through the proto_build lib.

The library also re-exports the upstream codegen crates pbjson_build, prost, prost_types, protox, and tonic_prost_build, so downstream consumers can drive codegen without depending on them directly.

DescriptorGraph::new, generate_accessors, and generate_field_info are now pub rather than pub(crate) so the binary can call them across the library boundary.

Previously, `proto-build` was a binary-only crate with all codegen
modules and the driver logic living in `main.rs`. With this commit, the
codegen modules move into a new library target so they can be reused by
other crates, while `main.rs` retains the driver entry point and reaches
the modules through the `proto_build` lib.

The library also re-exports the upstream codegen crates `pbjson_build`,
`prost`, `prost_types`, `protox`, and `tonic_prost_build`, so downstream
consumers can drive codegen without depending on them directly.

`DescriptorGraph::new`, `generate_accessors`, and `generate_field_info`
are now `pub` rather than `pub(crate)` so the binary can call them across
the library boundary.
@bmwill bmwill merged commit 49345f1 into master May 31, 2026
12 checks passed
@bmwill bmwill deleted the proto-build-lib branch May 31, 2026 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant