# 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 git:hooks: desc: sets up the githooks for the project cmd: git config core.hooksPath .githooks