-
Notifications
You must be signed in to change notification settings - Fork 58
Expand file tree
/
Copy pathbuild.rs
More file actions
26 lines (20 loc) · 877 Bytes
/
build.rs
File metadata and controls
26 lines (20 loc) · 877 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
// Build script for fnox
// Generates settings code from settings.toml
// Generates provider code from providers/*.toml
#[path = "build/generate_settings.rs"]
mod generate_settings;
#[path = "build/generate_providers.rs"]
mod generate_providers;
fn main() {
// Tell Cargo to rerun this build script if settings.toml changes
println!("cargo:rerun-if-changed=settings.toml");
// Tell Cargo to rerun this build script if any provider toml changes
println!("cargo:rerun-if-changed=providers");
for entry in std::fs::read_dir("providers").unwrap().flatten() {
println!("cargo:rerun-if-changed={}", entry.path().display());
}
// Generate settings code
generate_settings::generate().expect("Failed to generate settings code");
// Generate provider code
generate_providers::generate().expect("Failed to generate provider code");
}