You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
2.0KB

  1. set dotenv-load := true
  2. rustc-version := "nightly"
  3. #export RUSTFLAGS := "-C link-arg=-fuse-ld=lld -Ztime-passes"
  4. export RUSTFLAGS := "-C link-arg=-fuse-ld=lld -C target-cpu=native"
  5. cargo cmd +args='':
  6. cd {{invocation_directory()}} && cargo +{{rustc-version}} {{cmd}} {{args}}
  7. # cargo check {{args}}
  8. check +args='': && (cargo "check" args)
  9. # cargo test {{args}}
  10. test +args='': && (cargo "test" args)
  11. # cargo bench {{args}}
  12. bench +args='': && (cargo "bench" args)
  13. # cargo update {{args}}
  14. update +args='': && (cargo "update" args)
  15. # cargo run {{args}}
  16. run +args='': && (cargo "run" args)
  17. # cargo doc --open {{args}}
  18. doc +args='': && (cargo "doc" "--open" args)
  19. # just rebuild docs, don't open browser page again
  20. redoc +args='': && (cargo "doc" args)
  21. # like doc, but include private items
  22. doc-priv +args='': && (cargo "doc" "--open" "--document-private-items" args)
  23. # cargo build --bin {{binary-name}} {{args}}
  24. debug-build binary-name +args='': && (cargo "build" "--bin" binary-name args)
  25. # cargo build --bin {{binary-name}} --release {{args}}
  26. release-build binary-name +args='': && (cargo "build" "--bin" binary-name "--release" args)
  27. # cargo build --example {{example-name}} {{args}}
  28. example example-name +args='': && (cargo "build" "--example" example-name args)
  29. # display env variables that will be used for building
  30. show-build-env:
  31. @ echo "invocation_dir() = {{invocation_directory()}}"
  32. @ echo "rustc-version = {{rustc-version}}"
  33. @ env | rg '(RUST|SCC)' -i --color never
  34. pre-release: && (cargo "check") (cargo "test") (cargo "clippy") (cargo "fmt")
  35. cache-stats:
  36. sccache -s
  37. set-git-email email +dirs:
  38. echo "setting git email to {{email}} for {{dirs}}"
  39. for DIR in {{dirs}}; do \
  40. [ -d $DIR/.git ] && git -C $DIR config user.email "{{email}}" || echo "no $DIR/.git folder, skipping..."; \
  41. done
  42. show-git-email dir:
  43. @[ -d {{dir}}/.git ] && echo "{{dir}},$(git -C {{dir}} config user.email)" || exit 0
  44. show-git-emails:
  45. fd -t d . --max-depth 1 -x just show-git-email {} | xsv sort -s 2,1 | xsv table