refactor: generate the pb files using build.rs

This commit is contained in:
appflowy
2022-02-08 14:36:59 +08:00
parent 59aed762e7
commit 9135b92a39
73 changed files with 660 additions and 1188 deletions

View File

@ -27,3 +27,6 @@ ot = ["lib-ot"]
serde = ["serde_json"]
http_server = ["http-flowy"]
db = ["flowy-database", "lib-sqlite", "r2d2"]
[build-dependencies]
lib-infra = { path = "../../../shared-lib/lib-infra", features = ["gen_pb"] }

View File

@ -0,0 +1,5 @@
use lib_infra::pb;
fn main() {
pb::gen("flowy-error", "./src/protobuf/proto");
}

View File

@ -1,4 +1,4 @@
// This file is generated by rust-protobuf 2.22.1. Do not edit
// This file is generated by rust-protobuf 2.25.2. Do not edit
// @generated
// https://github.com/rust-lang/rust-clippy/issues/702
@ -21,7 +21,7 @@
/// Generated files are compatible only with the same version
/// of protobuf runtime.
// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
#[derive(PartialEq,Clone,Default)]
pub struct FlowyError {
@ -219,15 +219,7 @@ impl ::protobuf::reflect::ProtobufValue for FlowyError {
static file_descriptor_proto_data: &'static [u8] = b"\
\n\x0cerrors.proto\"2\n\nFlowyError\x12\x12\n\x04code\x18\x01\x20\x01(\
\x05R\x04code\x12\x10\n\x03msg\x18\x02\x20\x01(\tR\x03msgJ\x98\x01\n\x06\
\x12\x04\0\0\x05\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\x12\
\x04\x02\0\x05\x01\n\n\n\x03\x04\0\x01\x12\x03\x02\x08\x12\n\x0b\n\x04\
\x04\0\x02\0\x12\x03\x03\x04\x13\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x03\
\x04\t\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x03\n\x0e\n\x0c\n\x05\x04\0\
\x02\0\x03\x12\x03\x03\x11\x12\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x04\x04\
\x13\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x04\x04\n\n\x0c\n\x05\x04\0\
\x02\x01\x01\x12\x03\x04\x0b\x0e\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\
\x04\x11\x12b\x06proto3\
\x05R\x04code\x12\x10\n\x03msg\x18\x02\x20\x01(\tR\x03msgb\x06proto3\
";
static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;