(executable
 (public_name refmt)
 (package reason)
 (modes exe byte)
 (modules refmt)
 (libraries refmt_lib))

(library
 (public_name reason.refmt-lib)
 (name refmt_lib)
 (modules :standard \ refmt)
 (libraries reason reason.cmdliner dune-build-info))

(rule
 (with-stdout-to
  git_commit.ml
  (progn
   (bash "echo let version = \\\"$(git rev-parse --verify HEAD)\\\"")
   (bash "echo let short_version = \\\"$(git rev-parse --short HEAD)\\\""))))

(rule
 (with-stdout-to
  refmt.1
  (run %{bin:refmt} --help=groff)))

(install
 (section man)
 (package reason)
 (files refmt.1))
