Skip to content

Commit

Permalink
Use Build_info for versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
n-osborne committed Apr 9, 2024
1 parent 0023018 commit 31203f8
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 2 deletions.
7 changes: 6 additions & 1 deletion bin/cli.ml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ let () =
| [] -> usage ()
| cmds ->
let doc = "Run ORTAC." in
let version = "ortac version %%VERSION%%" in
let version =
Printf.sprintf "ortac version: %s"
(match Build_info.V1.version () with
| None -> "n/a"
| Some v -> Build_info.V1.Version.to_string v)
in
let info = Cmd.info "ortac" ~doc ~version in
let group = Cmd.group info cmds in
Stdlib.exit (Cmd.eval group)
8 changes: 7 additions & 1 deletion bin/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
(public_name ortac)
(modules sites cli)
(package ortac-core)
(libraries dune-site.plugins cmdliner fmt gospel registration))
(libraries
dune-build-info
dune-site.plugins
cmdliner
fmt
gospel
registration))

(library
(public_name ortac-core.register)
Expand Down
3 changes: 3 additions & 0 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
(using dune_site 0.1)
(using mdx 0.4)

(version 0.1.0+dev)

(name ortac)
(license MIT)
(source (github ocaml-gospel/ortac))
Expand All @@ -29,6 +31,7 @@
(documentation "https://ocaml-gospel.github.io/ortac/ortac-core/")
(depends
(ocaml (>= 4.11.0))
dune-build-info
dune-site
(cmdliner (>= 1.1.0))
fmt
Expand Down
2 changes: 2 additions & 0 deletions ortac-core.opam
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "0.1.0+dev"
synopsis:
"Ortac (OCaml Runtime Assertion Checking) core tool and library based on Gospel"
description: """
Expand All @@ -25,6 +26,7 @@ bug-reports: "https://github.com/ocaml-gospel/ortac/issues"
depends: [
"dune" {>= "3.8"}
"ocaml" {>= "4.11.0"}
"dune-build-info"
"dune-site"
"cmdliner" {>= "1.1.0"}
"fmt"
Expand Down
1 change: 1 addition & 0 deletions ortac-dune.opam
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "0.1.0+dev"
synopsis: "Generate dune rules for other ortac plugins"
description: "Generate dune rules for other ortac plugins"
maintainer: ["Nicolas Osborne <nicolas.osborne@tarides.com>"]
Expand Down
1 change: 1 addition & 0 deletions ortac-examples.opam
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "0.1.0+dev"
synopsis: "Ortac examples on different libraries"
maintainer: ["Nicolas Osborne <nicolas.osborne@tarides.com>"]
authors: [
Expand Down
1 change: 1 addition & 0 deletions ortac-monolith.opam
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "0.1.0+dev"
synopsis: "Monolith plugin for Ortac"
description: """
The Monolith plugin for the Ortac command-line tool (provided by
Expand Down
1 change: 1 addition & 0 deletions ortac-qcheck-stm.opam
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "0.1.0+dev"
synopsis: "QCheck-STM plugin for Ortac"
description: """
The QCheck-STM plugin for the Ortac command-line tool (provided by
Expand Down
1 change: 1 addition & 0 deletions ortac-runtime-monolith.opam
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "0.1.0+dev"
synopsis: "Runtime support library for Ortac/Monolith-generated code"
description: """
The ortac-runtime-monolith library provides support for the code
Expand Down
1 change: 1 addition & 0 deletions ortac-runtime-qcheck-stm.opam
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "0.1.0+dev"
synopsis: "Runtime support library for Ortac/QCheck-STM-generated code"
description: """
The ortac-runtime-qcheck-stm library provides support for the code
Expand Down
1 change: 1 addition & 0 deletions ortac-runtime.opam
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "0.1.0+dev"
synopsis: "Runtime support library for Ortac-generated code"
description: """
The ortac-runtime library provides support for the code generated
Expand Down
1 change: 1 addition & 0 deletions ortac-wrapper.opam
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "0.1.0+dev"
synopsis: "Wrapper plugin for Ortac"
description: """
The Wrapper plugin for the Ortac command-line tool (provided by the
Expand Down

0 comments on commit 31203f8

Please sign in to comment.