From 0e16c8ee178bafc5cc709bd7a77d6e1878bf9cea Mon Sep 17 00:00:00 2001 From: jutty Date: Wed, 16 Apr 2025 19:09:15 -0300 Subject: [PATCH] OCaml: Rename and expand justfile --- ocaml/.justfile | 68 +++++++++++++++++++++++++++++++++++++++++++++++++ ocaml/justfile | 25 ------------------ 2 files changed, 68 insertions(+), 25 deletions(-) create mode 100644 ocaml/.justfile delete mode 100644 ocaml/justfile diff --git a/ocaml/.justfile b/ocaml/.justfile new file mode 100644 index 0000000..ea6561a --- /dev/null +++ b/ocaml/.justfile @@ -0,0 +1,68 @@ +_default: + @just --list + +# Build project with Dune +[group('build')] +build: + dune build + +alias b := build + +# Cleanup build artifacts +[group('build')] +clean: + dune clean + +alias c := clean + +# Generate coverage files and report +[group('checks')] +cover : clean build + find . -name '*.coverage' -exec rm -v '{}' ';' + dune runtest --instrument-with bisect_ppx --force + bisect-ppx-report html + bisect-ppx-report summary + +# Clean, build, run checks and tests with coverage +[group('checks')] +full-build: clean check cover + +alias fb := full-build + +# Check formatting and run tests with coverage +[group('checks')] +check: format-check cover + +alias ck := check + +# Run tests +[group('checks')] +test : build + dune test + +alias t := test + +# Format all files +[group('checks')] +format: + dune fmt + dune promote + +alias fmt := format + +# Check formatting without changing files +[group('checks')] +format-check: + dune fmt --preview + +alias f := format-check + +# Show system, compiler and tooling information +info: + @echo OCaml version: $(ocamlc --version) + @echo Dune version: $(dune --version) + @echo Git version: $(git --version | cut -f 3 -d ' ') + @echo Just version: $(just --version | cut -f 2 -d ' ') + @echo OS/Arch: {{ os() }} {{ arch() }} + @echo GCC Triplet: $(gcc -dumpmachine) + @echo Shell: {{ env('SHELL') }} diff --git a/ocaml/justfile b/ocaml/justfile deleted file mode 100644 index 616c1b1..0000000 --- a/ocaml/justfile +++ /dev/null @@ -1,25 +0,0 @@ -default: - @just --list - -build : - dune build - -test : - dune build - dune test - -format : - dune fmt; dune promote - -format-check fmt-ck : - dune fmt --preview - -cover : - find . -name '*.coverage' -exec rm -v '{}' ';' - dune build - dune runtest --instrument-with bisect_ppx --force - bisect-ppx-report html - bisect-ppx-report summary - -clean : - dune clean