-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.rs
More file actions
26 lines (21 loc) · 796 Bytes
/
build.rs
File metadata and controls
26 lines (21 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use std::io::Result;
fn main() -> Result<()> {
// Configure prost-build to generate Rust code from TRON .proto files
let mut config = prost_build::Config::new();
// Enable type attributes for better ergonomics
config.type_attribute(".", "#[derive(serde::Serialize, serde::Deserialize)]");
// Compile TRON protocol buffer files
config.compile_protos(
&[
"proto/tron/Tron.proto",
"proto/tron/smart_contract.proto",
"proto/tron/balance_contract.proto",
"proto/tron/common.proto",
"proto/tron/Discover.proto",
],
&["proto/tron/"],
)?;
// Tell Cargo to rerun this build script if proto files change
println!("cargo:rerun-if-changed=proto/tron/");
Ok(())
}