summaryrefslogtreecommitdiff
path: root/2024/ocaml/Taskfile.yml
blob: 1d8a89e14a6232d7069efac08a607107a01546d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# https://taskfile.dev

version: "3"
vars:
  PROJECT_NAME: AoC_2024
tasks:
  default:
    desc: Prints this message
    cmds:
      - cmd: task --list-all
  build:doc:
    desc: Builds documentation using ocamldoc
    preconditions:
      - which ocamldoc
    cmds:
      - cmd: ocamldoc -html -d docs bin/main.ml
    silent: true
  build:
    desc: Builds the project
    preconditions:
      - which dune
    cmds:
      - cmd: dune build
  test:
    desc: Runs the tests in the 'tests' directory
    ignore_error: true
    env:
      OUNIT_CI: true
    preconditions:
      - which dune
    deps:
      - task: build
    cmds:
      - cmd: dune test {{.CLI_ARGS}}
  test:watch:
    desc: Continuously runs the tests in the 'tests' directory
    ignore_error: true
    sources:
      - lib/**/*.ml
      - test/**/*.ml
    env:
      OUNIT_CI: true
    preconditions:
      - which dune
    deps:
      - task: build
    cmds:
      - cmd: dune test --watch {{.CLI_ARGS}}
  run:
    desc: Runs the project
    preconditions:
      - which dune
    deps:
      - task: build
    cmds:
      - cmd: dune exec {{.PROJECT_NAME}}