Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 977 Bytes

README.md

File metadata and controls

36 lines (27 loc) · 977 Bytes

Sample project in OCaml using Dune

Building

To build the project using Dune you can run

dune build

This will build the project, the compiled files are located in the /_build/default/ directory.

During development, you can use dune watch mode

dune build --watch

This will rebuild the project every time you modify and save a project file.

We can run the executable from the project using

dune exec ex_main

Running tests can be done with the command

dune test

Project structure

The project includes three subparts

  • lib a folder defining a library
  • bin a folder containing an executable that uses the library defined in lib
  • test a folder containing tests of the library defined in lib

Each folder contains a dune file, describing how the project should be built. The dune-project is the main dune file. It specifies metadata about the project.