forked from HULKs/hulk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.rs
More file actions
19 lines (16 loc) · 690 Bytes
/
Copy pathbuild.rs
File metadata and controls
19 lines (16 loc) · 690 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use code_generation::{generate, write_to_file::WriteToFile, ExecutionMode};
use color_eyre::eyre::{Result, WrapErr};
use hulk_manifest::collect_hulk_cyclers;
use source_analyzer::{pretty::to_string_pretty, structs::Structs};
fn main() -> Result<()> {
let cyclers = collect_hulk_cyclers("..")?;
for path in cyclers.watch_paths() {
println!("cargo:rerun-if-changed={}", path.display());
}
println!();
println!("{}", to_string_pretty(&cyclers)?);
let structs = Structs::try_from_cyclers(&cyclers)?;
generate(&cyclers, &structs, ExecutionMode::Run)
.write_to_file("generated_code.rs")
.wrap_err("failed to write generated code to file")
}