From 6d8fb621d1e93b83786890d6d9cb6f0d8defa8ae Mon Sep 17 00:00:00 2001 From: DJ O'Leary Date: Fri, 26 Jun 2026 18:04:09 +0200 Subject: refactor!: invert repo directory structure now is language first --- ocaml/Taskfile.yaml | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 ocaml/Taskfile.yaml (limited to 'ocaml/Taskfile.yaml') diff --git a/ocaml/Taskfile.yaml b/ocaml/Taskfile.yaml new file mode 100644 index 0000000..4a4cbe2 --- /dev/null +++ b/ocaml/Taskfile.yaml @@ -0,0 +1,103 @@ +# https://taskfile.dev +version: "3" + +tasks: + + default: + desc: Prints this message + cmds: + - cmd: task --list-all + + docs: + desc: Builds documentation + preconditions: + - command -v ocamldoc + cmds: + - cmd: ocamldoc -html -d docs bin/main.ml + silent: true + + test: + desc: Runs the tests + preconditions: + - command -v dune + deps: + - task: build + cmds: + - cmd: dune runtest {{.CLI_ARGS}} + + test:watch: + desc: Continuously runs the tests + ignore_error: true + sources: + - lib/**/*.ml + - test/**/*.ml + preconditions: + - command -v dune + deps: + - task: build + cmds: + - cmd: dune runtest --watch {{.CLI_ARGS}} + + test:coverage: + desc: Runs the tests and reports coverage + preconditions: + - command -v dune + - command -v bisect-ppx-report + deps: + - task: build + cmds: + - cmd: rm --recursive --force _coverage + - cmd: rm --force _build/default/test/bisect*.coverage + - cmd: dune runtest --instrument-with bisect_ppx --force {{.CLI_ARGS}} + - cmd: bisect-ppx-report html + + test:suite: + desc: Run a singluar test suite, e.g. `task test:suite SUITE=test/domain/d01p01` + preconditions: + - command -v dune + deps: + - task: build + requires: + vars: + - SUITE + cmds: + - cmd: dune exec {{.SUITE}}.exe -- {{.CLI_ARGS}} + + build: + desc: Builds the project + preconditions: + - command -v dune + cmds: + - cmd: dune build + + build:watch: + desc: Builds the project when files change + preconditions: + - command -v dune + cmds: + - cmd: dune build --watch {{.CLI_ARGS}} + + build:release: + desc: Builds a release version the project + preconditions: + - command -v dune + cmds: + - cmd: dune build --release + + run: + desc: Runs the project + preconditions: + - command -v dune + deps: + - task: build + cmds: + - cmd: dune exec -- ./bin/main.exe {{.CLI_ARGS}} + + repl: + desc: Opens a REPL for the project + interactive: true + preconditions: + - command -v dune + - command -v utop + cmds: + - cmd: dune utop -- cgit v1.2.3