5fa7a82548
- Add .gitignore and .env.example files for project setup - Create build script for proto compilation with tonic-prost - Generate Cargo.lock with all project dependencies - Configure project structure and ignore patterns for development environment
16 lines
436 B
Rust
16 lines
436 B
Rust
use std::{env, path::PathBuf};
|
|
|
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
println!("cargo:rerun-if-changed=proto/email.proto");
|
|
println!("cargo:rerun-if-changed=proto");
|
|
|
|
let out_dir = PathBuf::from(env::var("OUT_DIR")?).join("pb");
|
|
std::fs::create_dir_all(&out_dir)?;
|
|
|
|
tonic_prost_build::configure()
|
|
.out_dir(&out_dir)
|
|
.compile_protos(&["proto/email.proto"], &["proto"])?;
|
|
|
|
Ok(())
|
|
}
|