Skip to content

Commit

Permalink
Use version from dune build info
Browse files Browse the repository at this point in the history
  • Loading branch information
dmtrKovalenko committed Aug 25, 2024
1 parent b484930 commit f068899
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 5 deletions.
7 changes: 6 additions & 1 deletion bin/ODiffBin.ml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ let cmd =
$ diffColor $ parsableOutput $ antialiasing $ ignoreRegions $ diffLines
$ disableGcOptimizations

let version =
match Build_info.V1.version () with
| None -> "dev"
| Some v -> Build_info.V1.Version.to_string v

let info =
let man =
[
Expand All @@ -86,7 +91,7 @@ let info =
`P "Supported image types: .png, .jpg, .jpeg, .tiff";
]
in
Cmd.info "odiff" ~version:"3.0.1" ~doc:"Find difference between 2 images."
Cmd.info "odiff" ~version ~doc:"Find difference between 2 images."
~exits:
[
Cmd.Exit.info 0 ~doc:"on image match";
Expand Down
2 changes: 1 addition & 1 deletion bin/dune
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
(package odiff)
(flags
(:standard -w -27))
(libraries odiff-core odiff-io cmdliner))
(libraries odiff-core odiff-io cmdliner dune-build-info))

(env
(dev
Expand Down
4 changes: 3 additions & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@

(package
(name odiff)
(version 3.1.0)
(synopsis "CLI for comparing images pixel-by-pixel")
(depends
odiff-core
odiff-io
(dune-build-info (>= 3.16.0))
(cmdliner (= 1.3.0))
)
)
Expand All @@ -43,7 +45,7 @@
dune
odiff-core
(ocaml (= 5.2.0))
(dune-configurator (>= 2.8))
(dune-configurator (>= 3.16.0))
)
)

Expand Down
2 changes: 1 addition & 1 deletion odiff-io.opam
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ depends: [
"dune" {>= "2.8"}
"odiff-core"
"ocaml" {= "5.2.0"}
"dune-configurator" {>= "2.8"}
"dune-configurator" {>= "3.16.0"}
"odoc" {with-doc}
]
build: [
Expand Down
2 changes: 2 additions & 0 deletions odiff.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: "3.1.0"
synopsis: "CLI for comparing images pixel-by-pixel"
maintainer: ["https://dmtrkovalenko.dev" "[email protected]"]
authors: ["Dmitriy Kovalenko"]
Expand All @@ -10,6 +11,7 @@ depends: [
"dune" {>= "2.8"}
"odiff-core"
"odiff-io"
"dune-build-info" {>= "3.16.0"}
"cmdliner" {= "1.3.0"}
"odoc" {with-doc}
]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "odiff-bin",
"version": "3.0.1",
"version": "3.1.0",
"author": "Dmitriy Kovalenko <[email protected]>",
"license": "MIT",
"description": "The fastest image difference tool in the world",
Expand Down

0 comments on commit f068899

Please sign in to comment.