forked from input-output-hk/mithril
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.rs
More file actions
23 lines (19 loc) · 728 Bytes
/
build.rs
File metadata and controls
23 lines (19 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// build.rs
use mithril_build_script::fake_aggregator::FakeAggregatorData;
use std::env;
use std::fs;
use std::path::Path;
fn main() {
let out_dir = env::var_os("OUT_DIR").unwrap();
let dest_path = Path::new(&out_dir).join("imported_data.rs");
let fake_aggregator_crate_path =
mithril_build_script::get_package_path("mithril-aggregator-fake");
let data_folder_path = fake_aggregator_crate_path.join("default_data");
let data = FakeAggregatorData::load_from_folder(&data_folder_path);
let generated_code = data.generate_code_for_ids();
fs::write(dest_path, generated_code).unwrap();
println!(
"cargo:rerun-if-changed={}/",
fake_aggregator_crate_path.display()
);
}