-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
41 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,57 @@ | ||
# list of the (last part of) folder names under the `xmpl` directory, space separated | ||
examples := `find ./xmpl -mindepth 1 -maxdepth 1 -type d | awk -F'/' '{print $(NF)}' | tr '\n' ' '` | ||
|
||
default: | ||
@just --list --unsorted | ||
# or: @just --choose | ||
|
||
# Clean Cargo's `target` and mdbook's `book` and `doctest_cache` directories | ||
clean: | ||
cargo clean | ||
mdbook clean | ||
rm --recursive --force ./doctest_cache/ | ||
|
||
# Format the code of all projects in the xmpl folder (DOES NOT INCLUDE examples embedded in the markdown) | ||
xfmt: | ||
for d in {{examples}}; do ( echo $d; cargo fmt -v --package $d ); done | ||
|
||
# Scan the code of all projects in the xmpl folder for common mistakes (DOES NOT INCLUDE examples embedded in the markdown) | ||
xclippy: | ||
for d in {{examples}}; do ( echo $d; cargo clippy --package $d ); done | ||
|
||
# Check all projects in the xmpl folder (and all of their dependencies) for errors | ||
xcheck: | ||
for d in {{examples}}; do ( echo $d; cargo check --package $d ); done | ||
# cargo check --workspace --all-targets --all-features | ||
|
||
# Compile all projects in the xmpl folder | ||
xbuild: | ||
for d in {{examples}}; do ( echo $d; cargo build --package $d ); done | ||
# cargo build --workspace --all-targets --all-features | ||
|
||
# Test all projects | ||
#xtest: | ||
# cargo test --workspace --all-targets --all-features | ||
|
||
# Build the book from its markdown files (incl. testing of the examples embedded in the markdown) | ||
build: | ||
cargo build | ||
mdbook build | ||
|
||
serve: test | ||
# Test the examples embedded in the markdown | ||
test: | ||
mdbook test | ||
# mdbook test --library-path /cargo-target-rust_howto/target/debug/deps/ | ||
# see: https://doc.rust-lang.org/rustdoc/command-line-arguments.html#-l--library-path-where-to-look-for-dependencies | ||
|
||
# Serve the book (incl. testing of the examples embedded in the markdown) | ||
serve: | ||
mdbook serve --open | ||
# to change the port: --port 3001 | ||
|
||
test: | ||
mdbook test | ||
# Watch the book's markdown files and rebuilds it on changes | ||
# watch: | ||
# mdbook watch --open | ||
|
||
# Update Cargo.lock dependencies for all projects (incl. dependencies used by the book and the xmpl folder) | ||
update: | ||
cargo update | ||
|