Skip to content

Commit

Permalink
feat(types): Expose FILE_DESCRIPTOR_SET (#1210)
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto authored Dec 22, 2022
1 parent fdff111 commit cc42d1f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tonic-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ prost-types = "0.11"
tonic = {version = "0.8", path = "../tonic"}

[dev-dependencies]
tonic-build = {version = "0.8", path = "../tonic-build", features = ["prost"]}
tonic-build = {version = "0.8", path = "../tonic-build", features = ["prost", "cleanup-markdown"]}
Binary file added tonic-types/src/generated/types.bin
Binary file not shown.
3 changes: 3 additions & 0 deletions tonic-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
/// Useful protobuf types
pub mod pb {
include!("generated/google.rpc.rs");

/// Byte encoded FILE_DESCRIPTOR_SET.
pub const FILE_DESCRIPTOR_SET: &[u8] = include_bytes!("generated/types.bin");
}

pub use pb::Status;
Expand Down
1 change: 1 addition & 0 deletions tonic-types/tests/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ fn bootstrap() {

tonic_build::configure()
.out_dir(format!("{}", out_dir.display()))
.file_descriptor_set_path(out_dir.join("types.bin"))
.compile(iface_files, dirs)
.unwrap();

Expand Down

0 comments on commit cc42d1f

Please sign in to comment.