From 636b7ba3bfb8e7d2e07cbf45368d1e5eb583a7e3 Mon Sep 17 00:00:00 2001 From: Jonathan Strong Date: Tue, 8 Jun 2021 03:08:59 -0400 Subject: [PATCH] add cargo commands --- justfile | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/justfile b/justfile index c22a4fe..66d5c47 100644 --- a/justfile +++ b/justfile @@ -1,2 +1,44 @@ -flush-cache: +export MAKEFLAGS := "-j8" +export RUSTFLAGS := "-C link-arg=-fuse-ld=lld -C target-cpu=native" + +cargo +args='': + cargo {{args}} + +check +args='': + @just cargo check {{args}} + +debug-build binary_name='binary-serialization' +args='': + @just cargo build --bin {{binary_name}} {{args}} + +release-build binary_name='polar' +args='': + @just cargo build --bin {{binary_name}} --release {{args}} + +example name +args='': + @just cargo build --example {{name}} {{args}} + +test +args='': + @just cargo test {{args}} + +doc +args='': + @just cargo doc --open {{args}} + +doc-priv +args='': + @just cargo doc --open --document-private-items {{args}} + +show-build-env: + @ env | rg RUST + @ env | rg '^MAKEFLAGS' | sort + +bench +args='': + @just cargo bench {{args}} + +update +args='': + @just cargo update {{args}} + +rebuild: + just cargo clean + just update + just test + +flush-disk-cache: sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches'