diff --git a/rust/perspective-viewer/Cargo.lock b/rust/perspective-viewer/Cargo.lock index 614887a540..2ad19553bb 100644 --- a/rust/perspective-viewer/Cargo.lock +++ b/rust/perspective-viewer/Cargo.lock @@ -908,7 +908,7 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "perspective" -version = "2.3.1" +version = "2.3.2" dependencies = [ "anyhow", "async-lock", @@ -941,7 +941,7 @@ dependencies = [ [[package]] name = "perspective-bundle" -version = "2.3.1" +version = "2.3.2" dependencies = [ "flate2", "wasm-bindgen-cli-support", diff --git a/rust/perspective-viewer/build.rs b/rust/perspective-viewer/build.rs index 1f11fb5b1b..ca96c98547 100644 --- a/rust/perspective-viewer/build.rs +++ b/rust/perspective-viewer/build.rs @@ -44,13 +44,16 @@ fn glob_with_wd(indir: &str, input: &str) -> Vec { } fn main() -> Result<(), anyhow::Error> { + let out_dir = std::env::var("OUT_DIR").unwrap(); + let out_path = std::path::Path::new(&out_dir); + let mut build = BuildCss::new("./src/less"); let files = glob_with_wd("./src/less", "**/*.less"); for src in files.iter() { build.add_file(src); } - build.compile()?.write("./target/css")?; + build.compile()?.write(out_path.join("css"))?; let mut build = BuildCss::new("./src/themes"); build.add_file("variables.less"); @@ -62,7 +65,7 @@ fn main() -> Result<(), anyhow::Error> { build.add_file("solarized-dark.less"); build.add_file("vaporwave.less"); build.add_file("themes.less"); - build.compile()?.write("./target/themes")?; + build.compile()?.write(out_path.join("themes"))?; println!( "cargo:rustc-env=PKG_VERSION={}", diff --git a/rust/perspective-viewer/src/rust/components/column_dropdown.rs b/rust/perspective-viewer/src/rust/components/column_dropdown.rs index 4bd4603c46..cb3ce5d27d 100644 --- a/rust/perspective-viewer/src/rust/components/column_dropdown.rs +++ b/rust/perspective-viewer/src/rust/components/column_dropdown.rs @@ -18,7 +18,7 @@ use super::modal::*; use crate::utils::WeakScope; use crate::*; -static CSS: &str = include_str!("../../../target/css/column-dropdown.css"); +static CSS: &str = include_str!(concat!(env!("OUT_DIR"), "/css/column-dropdown.css")); pub enum ColumnDropDownMsg { SetValues(Vec, f64), diff --git a/rust/perspective-viewer/src/rust/components/filter_dropdown.rs b/rust/perspective-viewer/src/rust/components/filter_dropdown.rs index bbf322c32b..9bd479faf9 100644 --- a/rust/perspective-viewer/src/rust/components/filter_dropdown.rs +++ b/rust/perspective-viewer/src/rust/components/filter_dropdown.rs @@ -17,7 +17,7 @@ use super::modal::*; use crate::utils::WeakScope; use crate::*; -static CSS: &str = include_str!("../../../target/css/filter-dropdown.css"); +static CSS: &str = include_str!(concat!(env!("OUT_DIR"), "/css/filter-dropdown.css")); pub enum FilterDropDownMsg { SetValues(Vec), diff --git a/rust/perspective-viewer/src/rust/components/function_dropdown.rs b/rust/perspective-viewer/src/rust/components/function_dropdown.rs index bed9a6f521..a81b14a8ba 100644 --- a/rust/perspective-viewer/src/rust/components/function_dropdown.rs +++ b/rust/perspective-viewer/src/rust/components/function_dropdown.rs @@ -18,7 +18,7 @@ use crate::exprtk::CompletionItemSuggestion; use crate::utils::WeakScope; use crate::*; -static CSS: &str = include_str!("../../../target/css/function-dropdown.css"); +static CSS: &str = include_str!(concat!(env!("OUT_DIR"), "/css/function-dropdown.css")); pub enum FunctionDropDownMsg { SetValues(Vec), diff --git a/rust/perspective-viewer/src/rust/components/style/mod.rs b/rust/perspective-viewer/src/rust/components/style/mod.rs index 83aeedb900..d4447197a9 100644 --- a/rust/perspective-viewer/src/rust/components/style/mod.rs +++ b/rust/perspective-viewer/src/rust/components/style/mod.rs @@ -38,25 +38,13 @@ macro_rules! css { ($name:expr) => {{ ( $name, - include_str!(concat!( - env!("CARGO_MANIFEST_DIR"), - "/target/css/", - $name, - ".css" - )), + include_str!(concat!(env!("OUT_DIR"), "/css/", $name, ".css")), ) }}; ($path:expr, $name:expr) => {{ ( $name, - include_str!(concat!( - env!("CARGO_MANIFEST_DIR"), - "/", - $path, - "/", - $name, - ".css" - )), + include_str!(concat!(env!("OUT_DIR"), "/", $path, "/", $name, ".css")), ) }}; }