name := 'cosmic-term' export APPID := 'com.system76.CosmicTerm' rootdir := '' prefix := '/usr' base-dir := absolute_path(clean(rootdir / prefix)) export INSTALL_DIR := base-dir / 'share' bin-src := 'target' / 'release' / name bin-dst := base-dir / 'bin' / name desktop := APPID + '.desktop' desktop-src := 'res' / desktop desktop-dst := clean(rootdir / prefix) / 'share' / 'applications' / desktop # Default recipe which runs `just build-release` default: build-release # Runs `cargo clean` clean: cargo clean # `cargo clean` and removes vendored dependencies clean-dist: clean rm -rf .cargo vendor vendor.tar # Compiles with debug profile build-debug *args: cargo build {{args}} # Compiles with release profile build-release *args: (build-debug '--release' args) # Compiles release profile with vendored dependencies build-vendored *args: vendor-extract (build-release '--frozen --offline' args) # Runs a clippy check check *args: cargo clippy --all-features {{args}} -- -W clippy::pedantic # Runs a clippy check with JSON message format check-json: (check '--message-format=json') # Run with debug logs run *args: env RUST_LOG=debug RUST_BACKTRACE=full cargo run --release {{args}} # Installs files install: install -Dm0755 {{bin-src}} {{bin-dst}} install -Dm0755 {{desktop-src}} {{desktop-dst}} # Uninstalls installed files uninstall: rm {{bin-dst}} # Vendor dependencies locally vendor: mkdir -p .cargo cargo vendor --sync Cargo.toml \ | head -n -1 > .cargo/config echo 'directory = "vendor"' >> .cargo/config tar pcf vendor.tar vendor rm -rf vendor # Extracts vendored dependencies vendor-extract: rm -rf vendor tar pxf vendor.tar