project_root := absolute_path(justfile_directory()) # Build the default variant of this package, its doc and perform all available # checks. default: build doc check ################################## # Build all variants of this package, its doc and perform all available checks all: build-all doc check # Clean all products of this justfile clean: clean-build #---------- # Building #---------- # Build all variants of this package. build-all: build-debug build-release build-release-no-log # Build the default variant of this package. build: build-release # Clean any products of the 'build' task clean-build: cargo clean # Build the debug version of this package. build-debug: RUSTFLAGS="-D warnings" cargo build build-release: RUSTFLAGS="-D warnings" cargo build --release build-release-no-log: RUSTFLAGS="-D warnings" cargo build --release --no-default-features --features "stm32f407" #---------- # Running #---------- # Run the built file in release mode run: cargo run --release #---------- # Checks #---------- # Run all available checks check: check-static check-test # Run cargo test with logging disabled check-test: cargo test --no-default-features # Run all static checks (i.e.: all checks but without any tests). check-static: check-formatting check-clippy # Check the formatting check-formatting: cargo fmt --all -- --check # Check clippy check-clippy: cargo clippy --all -- -D warnings #------ # Docs #------ # Build this package's documentation doc: doc-package # Clean any doc related build products clean-doc: clean-doc-package # Generates this package's full doc (including that of all its # dependencies) doc-package: cargo doc --all-features # Generates this package's full doc and launch a browser to it doc-package-preview: cargo doc --all-features --open # Generates only this package's doc (without any dependencies) doc-package-only: cargo doc --all-features --no-deps # Clean this package's doc clean-doc-package: cargo clean --doc #--------------- # Misc actions #--------------- # Format the rust code base format: cargo fmt --all # Analyze the functions' size of the release binary bloat-release: cargo bloat --release --full-fn --wide # Analyze the functions' size in the release binary without logs bloat-release-no-log: cargo bloat --release --no-default-features --features "stm32f407" --full-fn --wide # Analyze the crate's size in the release binary bloat-release-crate: cargo bloat --release --crates --split-std # Analyze the crate's size in the release binary bloat-release-crate-no-log: cargo bloat --release --no-default-features --features "stm32f407" --crates --split-std #---------- # Publish #---------- # Publish this package to crates.io publish: echo ${CARGO_REGISTRY_TOKEN} | cargo login cargo publish