package dkml-dune-dsl-show

  1. Overview
  2. Docs
An interpreter for the embedded DSL of Dune that shows the DSL as a real Dune file

Install

Dune Dependency

Authors

Maintainers

Sources

dkml-dune-dsl-0.1.0.tar.gz
md5=2c09714a7cb75c351d8b8fed6b186e2b
sha512=ce8a21efbc9a7f238de703206293f0a7c3eb938084afe0e582fefe58840d78939b0f8ab717ca745db732a1e50039bb0ab79618252c6e705adaeb5257e381de83

doc/index.html

dkml-dune-dsl-show index

Library dkml-dune-dsl-show

The entry point of this library is the module: DkmlDuneDslShow.

You use this library by:

  1. applying the DkmlDuneDslShow.I interpreter module to your Dune DSL expression
  2. converting the last step into an executable
  3. run the executable, capturing its results into a "dune.inc" include file
  4. running the "dune.inc" as part of your Dune build

All of that is represented by the following Dune snippet:

(rule
 (target dune_inc.ml)
 (action
  (with-stdout-to
   %{target}
   (echo
    ; YOU: Change "My_dune" to the name of your Dune DSL expression module
    "module M = My_dune.Build (DkmlDuneDslShow.I)
     let () = print_string @@ DkmlDuneDslShow.plain_hum M.res"))))

(executable
 (name dune_inc)
 ; YOU: Change "my_dune" to the name of your Dune DSL file
 (modules dune_inc my_dune)
 (libraries dkml-dune-dsl-show))

(rule
 (target dune.inc)
 (mode promote)
 (action
  (with-stdout-to
   %{target}
   (run ./dune_inc.exe))))

(include dune.inc)

You will need to change "my_dune" and the corresponding name of the module ("My_dune") in the above snippet.

OCaml

Innovation. Community. Security.