summaryrefslogtreecommitdiff
path: root/2025/ocaml/Taskfile.yaml
diff options
context:
space:
mode:
Diffstat (limited to '2025/ocaml/Taskfile.yaml')
-rw-r--r--2025/ocaml/Taskfile.yaml95
1 files changed, 95 insertions, 0 deletions
diff --git a/2025/ocaml/Taskfile.yaml b/2025/ocaml/Taskfile.yaml
new file mode 100644
index 0000000..7496067
--- /dev/null
+++ b/2025/ocaml/Taskfile.yaml
@@ -0,0 +1,95 @@
+# 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
+
+ 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