Extract Catala version from dune

(avoids multiple, possibly inconsistent, definitions ; also syncs up Clerk
versions with Catala)
This commit is contained in:
Louis Gesbert 2023-09-12 10:32:35 +02:00
parent 94ec864890
commit cf8f365cf7
6 changed files with 12 additions and 6 deletions

View File

@ -20,6 +20,10 @@ open Catala_utils
open Ninja_utils
module Nj = Ninja_utils
(* Retrieve current version from dune *)
let version =
Catala_utils.Cli.version
(** {1 Command line interface} *)
let files_or_folders =
@ -101,8 +105,6 @@ let clerk_t f =
$ reset_test_outputs
$ ninja_output)
let version = "0.5.0"
let info =
let doc =
"Build system for Catala, a specification language for tax and social \

View File

@ -25,6 +25,7 @@ depends: [
"cppo" {>= "1"}
"dates_calc" {>= "0.0.4"}
"dune" {>= "2.8"}
"dune-build-info" {>= "2.8"}
"js_of_ocaml-ppx" {= "4.1.0"}
"menhir" {>= "20200211"}
"menhirLib" {>= "20200211"}

View File

@ -11,6 +11,7 @@ homepage: "https://github.com/CatalaLang/catala"
bug-reports: "https://github.com/CatalaLang/catala/issues"
depends: [
"dune" {>= "2.8"}
"dune-build-info" {>= "2.8"}
"ocaml" {>= "4.11.0"}
"cmdliner" {>= "1.1.0"}
"re" {>= "1.9.0"}

View File

@ -321,7 +321,11 @@ module Flags = struct
have some randomness in them."
end
let version = "0.8.0"
(* Retrieve current version from dune *)
let version =
Option.value ~default:"dev"
Build_info.V1.(Option.map Version.to_string (version ()))
let s_plugins = "INSTALLED PLUGINS"
let info =

View File

@ -1,7 +1,7 @@
(library
(name catala_utils)
(public_name catala.catala_utils)
(libraries unix cmdliner ubase ocolor re bindlib catala.runtime_ocaml))
(libraries unix cmdliner ubase ocolor re bindlib catala.runtime_ocaml dune-build-info))
(documentation
(package catala)

View File

@ -2,8 +2,6 @@
(name catala)
(version 0.8.0)
(generate_opam_files false)
(formatting)