summaryrefslogtreecommitdiff
path: root/ocaml/Taskfile.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'ocaml/Taskfile.yaml')
-rw-r--r--ocaml/Taskfile.yaml103
1 files changed, 103 insertions, 0 deletions
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