From 0126c5c6fbf990beec72b2640cb3139949a59fba Mon Sep 17 00:00:00 2001 From: Michel Boucey Date: Sun, 7 May 2023 17:59:26 +0200 Subject: [PATCH] Get dynamically version during build time --- hash-addressed-cli/hash-addressed-cli.cabal | 2 ++ hash-addressed-cli/library/HashAddressed/App/Version.hs | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/hash-addressed-cli/hash-addressed-cli.cabal b/hash-addressed-cli/hash-addressed-cli.cabal index 9b11554..8e845ce 100644 --- a/hash-addressed-cli/hash-addressed-cli.cabal +++ b/hash-addressed-cli/hash-addressed-cli.cabal @@ -35,6 +35,8 @@ common base LambdaCase NamedFieldPuns NoImplicitPrelude + other-modules: + Paths_hash_addressed_cli build-depends: , base ^>= 4.16 || ^>= 4.17 , bytestring ^>= 0.11.3 diff --git a/hash-addressed-cli/library/HashAddressed/App/Version.hs b/hash-addressed-cli/library/HashAddressed/App/Version.hs index 121efae..269bb30 100644 --- a/hash-addressed-cli/library/HashAddressed/App/Version.hs +++ b/hash-addressed-cli/library/HashAddressed/App/Version.hs @@ -1,10 +1,15 @@ +{-# LANGUAGE CPP #-} +{-# LANGUAGE TemplateHaskell #-} + module HashAddressed.App.Version ( - version, + HashAddressed.App.Version.version ) where +import Data.Version (showVersion) +import Paths_hash_addressed_cli as P (version) import Prelude (String) version :: String -version = "2" +version = showVersion P.version