VSCode task definition to build OCaml project with dune

Does anybody have a task definition for VSCode to build an OCaml project with dune?

You should be able to define a custom task to achive this. Something like:

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Build",
            "type": "shell",
            "command": "dune build",
            "group": {
                "kind": "build",
                "isDefault": true
            }
        },
        {
            "label": "Test",
            "type": "shell",
            "command": "dune runtest -f",
            "group": {
                "kind": "test",
                "isDefault": true
            }
        }
    ]
}
3 Likes