build(simplify and fix build system, removing the binary assets)

This commit is contained in:
Brooks J Rady 2021-02-23 16:10:38 +00:00
parent 4d21e8f357
commit 3bc9fdbc0c
7 changed files with 10 additions and 10 deletions

Binary file not shown.

Binary file not shown.

View File

@ -13,7 +13,7 @@ cd ../strider
cargo build --release
echo "Optimising WASM executables (4/5)..."
cd ../..
wasm-opt -O target/wasm32-wasi/release/status-bar.wasm -o assets/plugins/status-bar.wasm
wasm-opt -O target/wasm32-wasi/release/strider.wasm -o assets/plugins/strider.wasm
wasm-opt -O target/wasm32-wasi/release/status-bar.wasm -o target/status-bar.wasm
wasm-opt -O target/wasm32-wasi/release/strider.wasm -o target/strider.wasm
echo "Building zellij (5/5)..."
cargo build $@

View File

@ -24,7 +24,7 @@ fn main() {
clap_app.gen_completions(BIN_NAME, Shell::Fish, &out_dir);
// Clear Default Plugins and Layouts
for entry in WalkDir::new("assets/") {
for entry in WalkDir::new("assets/layouts") {
let entry = entry.unwrap();
println!("cargo:rerun-if-changed={}", entry.path().to_string_lossy());
}

View File

@ -3,6 +3,6 @@
# can be further pinned eg:
# date: "stable-2020-07-10"
# version: "nightly-1.0.0"
channel = "stable"
channel = "1.49.0"
components = [ "rustfmt", "rust-src", "clippy", "rust-analysis"]
# targets = [ ]
targets = ["wasm32-wasi"]

View File

@ -4,7 +4,7 @@ macro_rules! asset_map {
{
let mut assets = std::collections::HashMap::new();
$(
assets.insert($path, include_bytes!(concat!("../assets/", $path)).to_vec());
assets.insert($path, include_bytes!(concat!("../", $path)).to_vec());
)+
assets
}

View File

@ -32,10 +32,10 @@ pub fn main() {
let project_dirs = ProjectDirs::from("org", "Zellij Contributors", "Zellij").unwrap();
let data_dir = project_dirs.data_dir();
let assets = asset_map! {
"plugins/status-bar.wasm",
"plugins/strider.wasm",
"layouts/default.yaml",
"layouts/strider.yaml"
"target/status-bar.wasm",
"target/strider.wasm",
"assets/layouts/default.yaml",
"assets/layouts/strider.yaml"
};
for (path, bytes) in assets {