Don't re-compile on every cargo run (#4019)

- Add new crate `substrate-build-script-utils` to unify the code of
`node`, `node-template` and `polkadot-node`.
- The `node-cli` build script needs to search upwards for the
`.git/HEAD` file to find it.
This commit is contained in:
Bastian Köcher
2019-11-05 19:36:10 +01:00
committed by GitHub
parent 350e72dac5
commit 508c52a08a
7 changed files with 66 additions and 20 deletions
+4 -3
View File
@@ -91,6 +91,7 @@ tempfile = "3.1.0"
[build-dependencies]
substrate-cli = { package = "substrate-cli", path = "../../core/cli" }
build-script-utils = { package = "substrate-build-script-utils", path = "../../core/utils/build-script-utils" }
structopt = "0.3.3"
vergen = "3.0.4"
@@ -118,7 +119,7 @@ cli = [
]
wasmtime = [
"cli",
"node-executor/wasmtime",
"substrate-cli/wasmtime",
"substrate-service/wasmtime",
"node-executor/wasmtime",
"substrate-cli/wasmtime",
"substrate-service/wasmtime",
]
+3 -3
View File
@@ -21,9 +21,9 @@ use vergen::{ConstantsFlags, generate_cargo_keys};
fn main() {
build_shell_completion();
generate_cargo_keys(ConstantsFlags::all())
.expect("Failed to generate metadata files");
println!("cargo:rerun-if-changed=.git/HEAD");
generate_cargo_keys(ConstantsFlags::all()).expect("Failed to generate metadata files");
build_script_utils::rerun_if_git_head_changed();
}
/// Build shell completion scripts for all known shells