Port Brave Sync server to Rust
Use SQLite for persistence and generate Rust protobuf bindings at build time. Add Docker image support for containerized deployment. Co-Authored-By: codex <[email protected]>
This commit is contained in:
commit
28826af88d
93 files changed
+11666
No files matched your search
@@ -0,0 +1,21 @@
|
||||
use std::{env, path::PathBuf};
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let proto_dir = PathBuf::from("schema/protobuf/sync_pb");
|
||||
let mut protos = Vec::new();
|
||||
for entry in std::fs::read_dir(&proto_dir)? {
|
||||
let path = entry?.path();
|
||||
if path.extension().is_some_and(|ext| ext == "proto") {
|
||||
println!("cargo:rerun-if-changed={}", path.display());
|
||||
protos.push(path);
|
||||
}
|
||||
}
|
||||
|
||||
let protoc = protoc_bin_vendored::protoc_bin_path()?;
|
||||
unsafe {
|
||||
env::set_var("PROTOC", protoc);
|
||||
}
|
||||
|
||||
prost_build::Config::new().compile_protos(&protos, &[proto_dir])?;
|
||||
Ok(())
|
||||
}
|
||||
Reference in new issue
Block a user