mirror of
https://github.com/italicsjenga/valence.git
synced 2024-12-23 22:41:30 +11:00
Specify rerun-if-changed files manually
This commit is contained in:
parent
f5f8264a70
commit
6be10bba5a
|
@ -1,20 +1,10 @@
|
||||||
use std::fs;
|
|
||||||
|
|
||||||
use anyhow::Context;
|
|
||||||
use proc_macro2::{Ident, Span};
|
use proc_macro2::{Ident, Span};
|
||||||
|
|
||||||
mod block;
|
mod block;
|
||||||
|
|
||||||
pub fn main() -> anyhow::Result<()> {
|
pub fn main() -> anyhow::Result<()> {
|
||||||
// If any of the files in the data directory are modified, rerun the build
|
for file in ["blocks.json"] {
|
||||||
// script.
|
println!("cargo:rerun-if-changed=data/{file}");
|
||||||
for entry in fs::read_dir("data")? {
|
|
||||||
let entry = entry?;
|
|
||||||
if entry.metadata()?.is_file() {
|
|
||||||
let buf = entry.path();
|
|
||||||
let path = buf.to_str().context("bad file name")?;
|
|
||||||
println!("cargo:rerun-if-changed={path}");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
block::build()?;
|
block::build()?;
|
||||||
|
|
Loading…
Reference in a new issue