|
- set dotenv-load := true
- rustc-version := "nightly"
-
- #export RUSTFLAGS := "-C link-arg=-fuse-ld=lld -Ztime-passes"
- export RUSTFLAGS := "-C link-arg=-fuse-ld=lld -C target-cpu=native"
-
- cargo cmd +args='':
- cd {{invocation_directory()}} && cargo +{{rustc-version}} {{cmd}} {{args}}
-
- # cargo check {{args}}
- check +args='': && (cargo "check" args)
-
- # cargo test {{args}}
- test +args='': && (cargo "test" args)
-
- # cargo bench {{args}}
- bench +args='': && (cargo "bench" args)
-
- # cargo update {{args}}
- update +args='': && (cargo "update" args)
-
- # cargo run {{args}}
- run +args='': && (cargo "run" args)
-
- # cargo doc --open {{args}}
- doc +args='': && (cargo "doc" "--open" args)
-
- # just rebuild docs, don't open browser page again
- redoc +args='': && (cargo "doc" args)
-
- # like doc, but include private items
- doc-priv +args='': && (cargo "doc" "--open" "--document-private-items" args)
-
- # cargo build --bin {{binary-name}} {{args}}
- debug-build binary-name +args='': && (cargo "build" "--bin" binary-name args)
-
- # cargo build --bin {{binary-name}} --release {{args}}
- release-build binary-name +args='': && (cargo "build" "--bin" binary-name "--release" args)
-
- # cargo build --example {{example-name}} {{args}}
- example example-name +args='': && (cargo "build" "--example" example-name args)
-
- # display env variables that will be used for building
- show-build-env:
- @ echo "invocation_dir() = {{invocation_directory()}}"
- @ echo "rustc-version = {{rustc-version}}"
- @ env | rg '(RUST|SCC)' -i --color never
-
- pre-release: && (cargo "check") (cargo "test") (cargo "clippy") (cargo "fmt")
-
- cache-stats:
- sccache -s
-
- set-git-email email +dirs:
- echo "setting git email to {{email}} for {{dirs}}"
- for DIR in {{dirs}}; do \
- [ -d $DIR/.git ] && git -C $DIR config user.email "{{email}}" || echo "no $DIR/.git folder, skipping..."; \
- done
-
- show-git-email dir:
- @[ -d {{dir}}/.git ] && echo "{{dir}},$(git -C {{dir}} config user.email)" || exit 0
-
- show-git-emails:
- fd -t d . --max-depth 1 -x just show-git-email {} | xsv sort -s 2,1 | xsv table
|