summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlurchi <lurchi@strangeplace.net>2017-03-15 23:53:37 +0100
committerlurchi <lurchi@strangeplace.net>2017-03-15 23:53:37 +0100
commitb3d231ef193aa1712d2ea8891223a3f94ef66594 (patch)
treeeb0c89fd292c35cce252d3e8e4af8d2be08a7187
parent9cf6724086ad5b9af315a3d7976bb5541341b505 (diff)
downloadsecushare-b3d231ef193aa1712d2ea8891223a3f94ef66594.tar.gz
secushare-b3d231ef193aa1712d2ea8891223a3f94ef66594.zip
rerun build script when a qml file is changed (Holzhammermethode)
-rw-r--r--prototype_2016/build.rs17
1 files changed, 14 insertions, 3 deletions
diff --git a/prototype_2016/build.rs b/prototype_2016/build.rs
index a27cecb..126368d 100644
--- a/prototype_2016/build.rs
+++ b/prototype_2016/build.rs
@@ -4,15 +4,19 @@ use std::process::Command;
4use std::str::from_utf8; 4use std::str::from_utf8;
5use std::env; 5use std::env;
6use std::path::Path; 6use std::path::Path;
7use std::fs;
7use fs_utils::*; 8use fs_utils::*;
8 9
9fn main() 10fn main()
10{ 11{
11 let out_dir = env::var("OUT_DIR").unwrap(); 12 let out_dir = env::var("OUT_DIR").unwrap();
13 let out_dir_path = Path::new(&out_dir);
14
12 let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap(); 15 let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
16 let resources_path = Path::new(&manifest_dir).join("resources");
13 17
14 let path = Path::new(&manifest_dir).join("resources"); 18 let _ = fs::remove_dir_all(out_dir_path.join("resources"));
15 let path_res = copy::copy_directory(&path, &out_dir); 19 let path_res = copy::copy_directory(&resources_path, &out_dir_path);
16 let path = match path_res { 20 let path = match path_res {
17 Ok(path) => path, 21 Ok(path) => path,
18 Err(err) => { 22 Err(err) => {
@@ -46,7 +50,14 @@ fn main()
46 to_utf(&fluid_build_output.stderr)); 50 to_utf(&fluid_build_output.stderr));
47 } 51 }
48 52
49 println!("cargo:rerun-if-changed=resources"); 53 println!("cargo:rerun-if-changed={}", resources_path.display());
54 println!("cargo:rerun-if-changed={}", resources_path.join("qml").display());
55 println!("cargo:rerun-if-changed={}", resources_path.join("qml").join("+material").display());
56 println!("cargo:rerun-if-changed={}", resources_path.join("qml").join("+universal").display());
57 println!("cargo:rerun-if-changed={}", resources_path.join("qml").join("Pages").join("Basic").display());
58 println!("cargo:rerun-if-changed={}", resources_path.join("qml").join("Pages").join("Material").display());
59 println!("cargo:rerun-if-changed={}", resources_path.join("qml").join("Pages").join("Navigation").display());
60 println!("cargo:rerun-if-changed={}", resources_path.join("qml").join("Pages").join("Style").display());
50 println!("cargo:rustc-link-search=native={}", path.display()); 61 println!("cargo:rustc-link-search=native={}", path.display());
51 println!("cargo:rustc-link-lib=static=resources"); 62 println!("cargo:rustc-link-lib=static=resources");
52 println!("cargo:rustc-link-lib=dylib=Qt5Svg"); 63 println!("cargo:rustc-link-lib=dylib=Qt5Svg");