catala/compiler/catala_utils/dune
Louis Gesbert 7b25a42970 Better version handling
Always generate the version through git when possible, and encode that within
the binaries so that `catala --version` does'nt give misleading information.

Previously we used dune's builtin functionality, but that resorts to a hack at
install time which is unpleasant and doesn't work with our use of `opam
install`.

The cost is a re-linking of catala_utils and the binaries upon git commit, which
is hardly noticeable.
2024-01-24 11:41:34 +01:00

25 lines
444 B
Plaintext

(library
(name catala_utils)
(public_name catala.catala_utils)
(modules
(:standard \ get_version))
(libraries unix cmdliner ubase ocolor re bindlib catala.runtime_ocaml))
(executable
(name get_version)
(modules get_version)
(libraries unix))
(documentation
(package catala)
(mld_files catala_utils))
(rule
(deps
(universe)
(env_var CATALA_VERSION))
(action
(with-stdout-to
version.ml
(run %{exe:get_version.exe}))))